This file contains 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
ls -l zsh_demo/**/*(Lk+3) |
This file contains 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(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)) { | |
}; |
This file contains 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
window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0) |
This file contains 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
// http://adripofjavascript.com/blog/drips/making-deep-property-access-safe-in-javascript.html | |
function deepGet (obj, props, defaultValue) { | |
// If we have reached an undefined/null property | |
// then stop executing and return the default value. | |
// If no default was provided it will be undefined. | |
if (obj === undefined || obj === null) { | |
return defaultValue; | |
} | |
// If the path array has no more elements, we've reached |
This file contains 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
[].slice.call(document.querySelectorAll('table tr td:nth-child(2)')).reduce((total, num) => { | |
let numValue = parseInt(num.innerHTML.replace('$', '')); | |
return total + numValue; | |
}, 0) + '$'; |
This file contains 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
var tl = new TimelineMax() | |
.from(myObj, 1, { /* ...values... */ }, 0) // Will play in every loop | |
.call(loopCheck) // End loop after X times | |
.from(myObj, 1, { /* ...values... */ }, 0) // Will not play on the last loop | |
.repeat(-1) | |
var loop = 0; | |
var loopMax = 3; | |
function loopCheck() { | |
loop++; |
This file contains 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
#!/bin/sh | |
# Downloads all vimcast videos & save a bookmark file in the same name | |
# Edit the number manually, have not found a way to get this automatically | |
for (( i = 1; i < 68; i++ )); do | |
FILE=$(curl -s http://media.vimcasts.org/videos/$i/ | grep m4v | sed 's/.*m4v\">\(.*m4v\)<\/a>.*/\1/g') | |
URL=http://media.vimcasts.org/videos/$i/$FILE | |
OUTPUT_VIDEO_FILE="0$i-$FILE" | |
OUTPUT_BOOKMARK_FILE="$OUTPUT_VIDEO_FILE.webloc" | |
echo "$URL" |
This file contains 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
#!/bin/bash | |
# Git branches to folders | |
function branch_folders { | |
# Check if folder is a git repository | |
if [[ ! -d ".git" ]]; then | |
echo -e "\n\tThis is not a git repository!\n" | |
exit | |
fi |
NewerOlder