I hereby claim:
- I am jsatk on github.
- I am jsatk (https://keybase.io/jsatk) on keybase.
- I have a public key whose fingerprint is 06D4 7A7E FE77 2731 0F67 075A 01BD 80DF DC5A C6E4
To claim this, I am signing this object:
| var longestPrefix = function (arr) { | |
| var firstString = arr[0], | |
| prefix = ''; | |
| for (var i = 0; i < firstString.length; i++) { | |
| for (var j = 1; j < arr.length; j++) { | |
| if (arr[j].charAt(i) !== firstString.charAt(i)) { | |
| return prefix; | |
| } | |
| } |
| var start, end, diff, splitString, nativeArray; | |
| splitString = function () { | |
| return 'foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars'.split(' '); | |
| }; | |
| nativeArray = function () { | |
| return ['foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars']; | |
| }; |
| # For Bash. Photo here: http://i.jsatk.us/image/403u443G2k06 | |
| PS1="\n\[$RESET\]┌─▪\[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]\[${BOLD}${MAGENTA}\]\u \[$WHITE\]on \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$RESET\]\n└─▪ " | |
| # For Fish. Photo here: http://i.jsatk.us/image/1Z0m132j181I | |
| function fish_prompt --description 'Write out the prompt' | |
| set -l last_status $status | |
| echo | |
| set_color magenta |
| var uniqueCharsInStringCounter = function (string) { | |
| var countOfChars = {}, numberCountAndUniqueChars = '', chars, uniqueChars; | |
| if (!string || typeof string !== 'string') { | |
| throw new Error('Must call method with a string as an argument.'); | |
| } | |
| chars = string.split('').sort(); | |
| uniqueChars = chars.filter(function (char, index, array) { | |
| return array.indexOf(char) === index; |
I hereby claim:
To claim this, I am signing this object:
| { | |
| "always_show_minimap_viewport": true, | |
| "auto_complete_commit_on_tab": true, | |
| "caret_style": "phase", | |
| "draw_minimap_border": true, | |
| "ensure_newline_at_eof_on_save": true, | |
| "highlight_line": true, | |
| "ignored_packages": | |
| [ | |
| "Vintage", |
| #!/usr/bin/ruby | |
| # Save file to a directory in your $PATH. | |
| # Ensure it is executable `chmod a+x clipboard_manipulation.rb`. | |
| # | |
| # Usage `copy some text like this`. | |
| # Then from the commandline run `clipboard_manipulation.rb space underscore`. | |
| # Your clipborad will now contain the text `copy_some_text_like_this`. | |
| # | |
| # This is a simply and silly script that scratched an itch I was having. |
| # For Bash Shell | |
| # Fix the shitty OS X Open With menu duplicates | |
| function fixopenwith() { | |
| /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user | |
| killall Finder | |
| echo 'Open With has been rebuilt, Finder will relaunch' | |
| } | |
| # For Fish Shell http://fishshell.com | |
| function fixopenwith --description 'Fix the shitty OS X Open With menu duplicates' |
| var ArrowJumpTo = function (event, elements) { | |
| var keyCheck, | |
| scrollToElement, | |
| getElementPositions, | |
| getPositionToScrollTo; | |
| keyCheck = function (event, elements) { | |
| if ([38, 40].indexOf(event.keyCode) === -1) return false; | |
| var els = elements || event.data.element; |
| var fuckYouIWantMyShitOnTop = function (idOfElementYouWantOnTop) { | |
| var all = document.getElementsByTagName("*"), | |
| maxZIndex = 9007199254740992, // https://gist.github.com/jsatk/7921133#comment-968150 | |
| i, highestZIndex, currentZIndex, currentEl; | |
| for (i = all.length - 1; i >= 0; i--) { | |
| currentEl = all[i]; | |
| currentZIndex = Number(currentEl.style.zIndex); | |
| if (isNaN(currentZIndex)) continue; |