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
nvm_update() { | |
for NVM_UPDATE_VER in 0.10 0.12 4 5 | |
do | |
# Install the latest versions of node only if they are already installed | |
nvm which $NVM_UPDATE_VER &>/dev/null && nvm install $NVM_UPDATE_VER | |
done | |
# Switch back to the default version of node | |
echo "Switching to default version of node..." | |
nvm use default | |
} |
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
% helper predicates | |
square_to_subgrid(Row, Col, Subgrid) :- | |
floor((Row - 1)/3, RowBase), | |
floor((Col - 1)/3, ColBase), | |
Subgrid is 3 * RowBase + ColBase + 1. | |
one_to_nine(X) :- | |
member( X, [1, 2, 3, 4, 5, 6, 7, 8, 9] ). | |
next_square( Puzzle, Row, Col ) :- | |
one_to_nine(Row), | |
one_to_nine(Col), |
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 | |
for file; | |
do | |
echo -e "\033[0;32m>> $file\033[0m" | |
if [ -e $file ]; then | |
_ext=${file##*.} | |
if [[ "gif png jpg jpeg" =~ $_ext ]]; then | |
if [ $_ext == "jpg" ]; then _ext="jpeg"; fi | |
php -r "echo(\"data:image/$_ext;base64,\".base64_encode(file_get_contents(\"$file\")).\"\\n\");" | |
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
javascript:(function(d){function h(e){if(typeof e!=='object')return;function o(e){var _x=0,_y=0;while(e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop)){_x+=e.offsetLeft;_y+=e.offsetTop;e=e.offsetParent;}return {top:_y,left:_x};}var p=o(e);c(p.left,p.top,e.clientWidth,e.clientHeight);}function c(x,y,w,h){var e=d.createElement('div');e.style.zIndex='999999';e.style.background='rgba(255,0,0,0.6)';e.style.position='absolute';e.style.left=x+'px';e.style.top=y+'px';e.style.width=w+'px';e.style.height=h+'px';d.body.appendChild(e);}var t=d.getElementsByTagName('table'),i,l=t.length;for(i=0;i<l;i++){h(t[i]);console.log(t[i]);}})(document); |
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
javascript:(function(w){alert((w.jQuery&&w.jQuery.fn.jquery)||'none');})(window); |
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(document) { | |
function getRandomInt(max) { | |
return Math.floor(Math.random() * max); | |
} | |
var sheets = document.styleSheets, | |
sheet = sheets[getRandomInt(sheets.length-1)], | |
rules = sheet.cssRules, | |
rule = getRandomInt(rules.length-1); |
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
javascript:(function(d){var%20s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';d.head.appendChild(s);})(document); |
NewerOlder