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 checkType (obj, typ) { | |
| typ = ((typ && typ.toLowerCase()) || false); | |
| var objTyp = Object | |
| .prototype | |
| .toString | |
| .call(obj) | |
| .replace('[object ', '') | |
| .replace(']', '') | |
| .toLowerCase(); |
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
| typeof({}); // => "object" | |
| typeof(1); // => "number" | |
| typeof(""); // => "string" | |
| typeof(function () {}); // => "function" | |
| typeof(undefined); // => "undefined" | |
| typeof(true); // => "boolean" |
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
| typeof(new Date()); // => "object" | |
| typeof([]); // => "object" | |
| typeof(null); // => "object" | |
| typeof(window); // => "object" | |
| typeof(new String()); // => "object" |
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
| Object.prototype.toString.call([]); // => "[object Array]" |
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
| window.open( | |
| 'data:text/csv;charset=utf-8,' + | |
| encodeURIComponent(' \ | |
| one,two,three \n\ | |
| 1,2,3 \n\ | |
| 4,5,6 \n\ | |
| ') | |
| ); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://addepar.github.io/ember-table/stylesheets/bootstrap.css"> | |
| <link rel="stylesheet" href="http://addepar.github.io/ember-table/stylesheets/font-awesome.css"> | |
| <link rel="stylesheet" href="http://addepar.github.io/ember-table/stylesheets/styles.css"> | |
| <link rel="stylesheet" href="http://addepar.github.io/ember-table/stylesheets/table-base.css"> | |
| <script src="http://addepar.github.io/ember-table/javascripts/lib/modernizr-2.6.1.min.js"></script> |
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
| # current tty's PIDs | |
| ps -fu `whoami` | grep 'pts/`tty | cut -d/ -f4`' | |
| # capture ip traffic | |
| ngrep -q -d any -W none ip | |
| # mitm proxy | |
| socat -v TCP-LISTEN:<port>,fork TCP:localhost:<port> | |
| # reverse tunnel |
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
| #!/bin/bash | |
| #brew install gnu-sed | |
| #ln -s /usr/local/bin/gsed /usr/local/bin/sed | |
| URL=$(echo "http://explainshell.com/explain?cmd=$1+${@:2}" | sed -e 's/ /+/g') | |
| curl -s "$URL" | sed -n '/<pre/,/<\/pre>/p' | sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | \ | |
| sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat |
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
| #!/bin/bash | |
| # | |
| # toggle AppleShowAllFiles | |
| # | |
| current_value=$(defaults read com.apple.finder AppleShowAllFiles) | |
| if [ $current_value = "TRUE" ] | |
| then | |
| defaults write com.apple.finder AppleShowAllFiles FALSE | |
| else |
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
| lynx -dump -nonumbers -nolist https://news.ycombinator.com/leaders | head -14 | tail |