This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Fixes some issues | |
| set nocompatible | |
| " Required by Vundle (init) | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| Plugin 'bling/vim-airline' | |
| Plugin 'airblade/vim-gitgutter' | |
| Plugin 'mattn/emmet-vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find /path/to/base/dir -type d -ctime +10 -exec rm -rf {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmap w!! %!sudo tee > /dev/null % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Can be used with e.g. Control Freak | |
| if (window.location.pathname === "/ad/locked") { | |
| var time = +$("#countdown").text() || 6; | |
| setTimeout(function () { | |
| window.location.href = window.location.href; | |
| }, time * 1000); | |
| } else { | |
| var myfunc = function () { | |
| if (typeof $("#skip_button").attr("href") == "undefined" || $("#skip_button").attr("href") == null || $("#skip_button").attr("href").length === 0) { | |
| setTimeout(myfunc, 500); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for f in *; do git mv -f "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime, sublime_plugin | |
| combinations = (('todo', '(.*)TODO:(.*)', 'variable.parameter'), ('fix','(.*)FIX:(.*)', 'invalid.depricated'), ('notabene', '(.*)NB:(.*)', 'string')) | |
| class HighlightText(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| view = self.view | |
| for combination in combinations: | |
| view.add_regions(combination[0], view.find_all(combination[1],0), combination[2], '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name '*.jpg' | awk 'BEGIN{ a=0 }{ printf "mv %s tile%02d.jpg\n", $0, a++ }' | bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime, sublime_plugin | |
| combinations = (('todo', '(.*)TODO:(.*)', 'string'), ('fix','(.*)FIX:(.*)', 'invalid')) | |
| class HighlightText(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| view = self.view | |
| for combination in combinations: | |
| regions = view.find_all(combination[1],0) | |
| view.add_regions(combination[0], regions, combination[2] , '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getScrollTop() { | |
| if (typeof window.pageYOffset !== 'undefined'){ | |
| return window.pageYOffset; | |
| } else { | |
| var iequirks = document.body; | |
| var iedoctype = document.documentElement; | |
| var doc = (iedoctype.clientHeight) ? iedoctype : iequirks; | |
| return doc.scrollTop; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!("placeholder" in document.createElement("input"))) { | |
| $("[placeholder]").each(function () { | |
| var placeholder = $(this).attr("placeholder"); | |
| $(this).val(placeholder).focus(function () { | |
| if ($(this).val() === placeholder) { | |
| $(this).val(""); | |
| } | |
| }).blur(function () { | |
| if ($(this).val().length === 0) { | |
| $(this).val(placeholder); |
NewerOlder