Skip to content

Instantly share code, notes, and snippets.

Dom Hastings dom111

Block or report user

Report or block dom111

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dom111
dom111 / install_tmux_osx_no_brew
Last active Oct 9, 2018 — forked from shrayasr/install_tmux_osx_no_brew
Install tmux on OSX WITHOUT brew - updated to use github urls
View install_tmux_osx_no_brew
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
curl -OL https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
# Extract them
tar xzf tmux-2.7.tar.gz
@dom111
dom111 / install_tmux_osx_no_brew
Last active Oct 9, 2018 — forked from Fi5t/install_tmux_osx_no_brew
Install tmux on OSX WITHOUT brew
View install_tmux_osx_no_brew
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL https://github.com/tmux/tmux/releases/download/2.7/tmux-2.7.tar.gz
curl -OL https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
# Extract them
tar xzf tmux-2.7.tar.gz
@dom111
dom111 / polyquine2.pl.rb.php.js.sh.py
Created Apr 27, 2018
Alternative Perl/Ruby/PHP/JavaScript/Bash/Python 2 polyquine
View polyquine2.pl.rb.php.js.sh.py
s=1//2;_=r'''<?#/.__id__;s=+0;#';read -d '' q<<'';s=\';Q='echo s=1//2\;_=r$s$s$s\<\?\#/.__id__\;s=+0\;#$s\;read -d $s$s q\<\<$s$s\;s=\\$s\;Q=$s$Q$s\;eval\ \$Q;echo $q';eval $Q
$_='$z=0?"$&".next+92 .chr+10 .chr: 0..a||eval("printf=console.log;unescape`$%27%5C%0Ak`");$q=$z[1]?$z[1]:h^O;printf("%s%s%s%s<?#/.__id__;s=+0;#%s;read -d %s%s q<<%s%s;s=%s%s;Q=%secho s=1//2%s;_=r%ss%ss%ss%s<%s?%s#/.__id__%s;s=+0%s;#%ss%s;read -d %ss%ss q%s<%s<%ss%ss%s;s=%s%s%ss%s;Q=%ss%sQ%ss%s;eval%s %s%sQ;echo %sq%s;eval %sQ%s%s_=%s%s%s;eval(%s_);//;#%s%s%s;f=%s%s%ss=1//2;_=r%%s%%s%%s;f=%%s%%s%%s;q=_[18]*3;print f%%%%(q,_,q,q,f,q)%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)%s",[]&&"s=1//2;_=r",$r=[]&&$q,$r,$r,$q,$q,$q,$q,$q,$b=$z[2]?$z[2]:chr(92),$q,$q,$b,$d=$z[0]?$z[0]:h^L,$d,$d,$b,$b,$b,$b,$b,$d,$b,$d,$d,$b,$b,$d,$d,$b,$b,$b,$d,$b,$d,$d,$d,$b,$b,$b,$d,$d,$q,$d,$n=$z[3]?$z[3]:chr(10),$d,$q,$_,$q,$d,$q,$q,$q,$q,$q,$q,$q,$q,$q,$z[4]?"":$n);';eval($_);//;#''';f='''s=1//2;_=r%s%s%s;f=%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)''';q=_[18]*3;print
@dom111
dom111 / quine.sh
Last active Feb 7, 2018
A bash quine using a standard quine apporach
View quine.sh
Q=\';q='echo "Q=\\$Q;q=$Q$q$Q;eval \$q"';eval $q
View proper-quine.js
Q="q=Q.link()[8];alert(`Q=${q+Q+q};eval(Q)`)";eval(Q)
// longer alternative:
console.log(a="console.log(a=%s%s%s,q=a.link()[8],a,q)",q=a.link()[8],a,q)
@dom111
dom111 / polyquine.pl.rb.php.js.sh.py
Last active Apr 27, 2018
Perl/Ruby/PHP/JavaScript/Bash/Python 2 polyquine
View polyquine.pl.rb.php.js.sh.py
s=1//2;_=r'''<?#/.__id__;s=+0;#';read -d '' q<<'';s=\';Q='echo s=1//2\;_=r$s$s$s\<\?\#/.__id__\;s=+0\;#$s\;read -d $s$s q\<\<$s$s\;s=\\$s\;Q=$s$Q$s\;eval\ \$Q;echo $q';eval $Q
$_='eval("0"?0?"def strtr(s,f,t);s.tr(f,t) end;class String;def chr(n);self+n.chr end;end":"$u=strtr=(s,f,t)=>[...f].reduce((s,a,i)=>s.replace(RegExp(a,`g`),t[i]),s);printf=console.log;(S=String).prototype.chr=function(n){return this+S.fromCharCode(n)}":[]&&"sub strtr{eval q(q(X)=~y/X/X/r)=~s/X/shift/ger}");printf(strtr("%s<?#/.__id__;s=+0;#j;read -d jj q<<jj;s=zj;Q=jecho s=1//2z;_=rksksksz<z?z#/.__id__z;s=+0z;#ksz;read -d ksks qz<z<ksksz;s=zzksz;Q=kskQksz;evalz zkQ;echo kqj;eval kQwk_=j%sj;eval(k_);//;#jjj;f=jjjs=1//2;_=r%%s%%s%%s;f=%%s%%s%%s;q=_[18]*3;print f%%%%(q,_,q,q,f,q)jjj;q=_[18]*3;print f%%(q,_,q,q,f,q)%s","jkwz","".chr(39).chr(36).chr(10).chr(92).chr(92)),[]&&"s=1//2;_=r".chr(39).chr(39).chr(39),$_,$u?"":"".chr(10));';eval($_);//;#''';f='''s=1//2;_=r%s%s%s;f=%s%s%s;q=_[18]*3;print f%%(q,_,q,q,f,q)''';q=_[18]*3;print f%(q,_,q,
View quine.js
s='s=S;console.log(s.replace(/S/,(q=String.fromCharCode(39))+s+q))';console.log(s.replace(/S/,(q=String.fromCharCode(39))+s+q))
// or
s='s=S;q=String.fromCharCode(39);console.log(s.replace(/S/,q+s+q))';q=String.fromCharCode(39);console.log(s.replace(/S/,q+s+q))
View mean-osx.sh
osascript -e 'tell application "System Events"
repeat while true
key down {shift}
delay 1
key up {shift}
delay (random number from 12 to 48)
end repeat
end tell' &
You can’t perform that action at this time.