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
/* extracted from http://www.iteral.com/jscrush/ by James Liu (@jamesliu96) */ | |
/* @aivopaas | licensed under MIT license */ | |
var JSCrush = function(s) { | |
Q = []; | |
for (i = 1000; --i; i - 10 && i - 13 && i - 34 && i - 39 && i - 92 && Q.push(String.fromCharCode(i))); | |
i = s = s.replace(/([\r\n]|^)\s*\/\/.*|[\r\n]+\s*/g, '').replace(/\\/g, '\\\\'), X = B = s.length / 2, O = m = ''; | |
for (S = encodeURI(i).replace(/%../g, 'i').length;; m = c + m) { | |
for (M = N = e = c = 0, i = Q.length; !c && --i; !~s.indexOf(Q[i]) && (c = Q[i])); | |
if (!c) break; | |
if (O) { |
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 mosaic = function(h, a) { | |
for (var f = h.data, m = h.width, n = h.height, k = 0, p = m / a | 0, l, q, g, b, c, e, d; k < p; k++) | |
for (l = 0, q = n / a | 0; l < q; l++) { | |
for (g = [], b = [0, 0, 0], c = 0; c < a; c++) | |
for (d = 0; d < a; d++) | |
e = (l * a + c) * m + k * a + d, b[0] += f[4 * e], b[1] += f[4 * e + 1], b[2] += f[4 * e + 2]; | |
g[0] = b[0] / (a * a), g[1] = b[1] / (a * a), g[2] = b[2] / (a * a); | |
for (c = 0; c < a; c++) | |
for (d = 0; d < a; d++) | |
e = (l * a + c) * m + k * a + d, f[4 * e] = g[0], f[4 * e + 1] = g[1], f[4 * e + 2] = g[2]; |
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 c = document.createElement('canvas'); | |
var ctx = c.getContext('2d'); | |
c.height = 300; | |
c.width = 300; | |
// ctx.fillStyle = "green"; | |
// ctx.fillRect(0, 0, 160, 50); | |
// ctx.fillRect(50, 50, 50, 50); | |
// ctx.fillRect(100, 100, 50, 60); |
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 | |
keyload() { | |
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ | |
} | |
keyunload() { | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ | |
} |
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 UUID = (function(r) { | |
return "xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, r); | |
})(function(c) { | |
var r = Math.random() * 16 | 0, | |
v = c == "x" ? r : (r & 3 | 8); | |
return v.toString(16); | |
}); |
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 | |
############## | |
# BILIBILI # | |
# BASH # | |
# DOWNLOADER # | |
############## | |
aid=`echo $1 | awk '{sub("av","");print}'` | |
page=$2 |
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
function dice(n) { var d = []; while(n > 0) { d.push(Math.ceil(6 * Math.random())); n--; } return d.sort(); } |
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 | |
sudo apt-get update | |
sudo apt-get install gcc g++ make | |
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev | |
wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz | |
tar -xzf ruby-2.2.2.tar.gz | |
cd ruby-2.2.2/ | |
./configure | |
make |
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 | |
if [ -z $1 ]; then | |
echo "Please specify username." | |
exit 1 | |
fi | |
search=`grep '^'$1'' /etc/ppp/chap-secrets` | |
if [ -n $search ]; then |
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 | |
USER=$2 | |
rm /var/run/pptpd/$USER |