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
# Minecraft PE v0.6.1 alpha Protocol #9 | |
# 49 identified Packets | |
[C ==> S] 0x82 LoginPacket (String, int, int) | |
[C <== S] 0x83 LoginStatusPacket (int) | |
[C ==> S] 0x84 ReadyPacket (bits[8]) | |
[C <== S] 0x85 MessagePacket (String) | |
[C <== S] 0x86 SetTimePacket (long) | |
[C <== S] 0x87 StartGamePacket (long, int, int, int, float, float, float) | |
[C <== S] 0x88 AddMobPacket (int, int, float, float, float, byte, byte, Metadata) |
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
wget -r -k -p the-site -X exclude-dir-1,exclude-dir-2 |
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
cp app-unsigned.apk temp.apk | |
jarsigner -verbose -keystore ~/.android/debug.keystore -digestalg SHA1 -sigalg MD5withRSA -storepass android -keypass android temp.apk androiddebugkey | |
$ANDROID_SDK/tools/zipalign -v 4 temp.apk temp.apkz | |
mv temp.apkz $1 && rm temp.apk |
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
import urllib.request as request | |
from urllib.error import HTTPError | |
import json | |
class YggAuth: | |
def __init__(self, | |
client_token=None, | |
access_token=None, | |
username=None, | |
password=None |
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/sh | |
# script to automate the creation of chroot jail | |
# w/ minimal executables to run git | |
export CHROOT=/var/chroot | |
function copy_binary() { | |
for i in $(ldd $*|grep -v dynamic|cut -d " " -f 3|sed 's/://'|sort|uniq) | |
do | |
cp --parents $i $CHROOT |
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
/* | |
Infix to postfix conversion in C++ | |
Input Postfix expression must be in a desired format. | |
Operands and operator, both must be single character. | |
Only '+' , '-' , '*', '/' and '$' (for exponentiation) operators are expected. | |
*/ | |
#include<iostream> | |
#include<stack> | |
#include<string> |
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
/** | |
* An accelerometer object for detecting device orientation | |
* and motion (if supported) | |
* | |
* Chrome 7+, Firefox 6+, IE11+, iOS Safari 4.0+, Android Browser 3.0, Blackberry 10.0 | |
* http://caniuse.com/#feat=deviceorientation | |
* | |
* The DeviceOrientationEvent.alpha value represents the motion of the device around the z axis, | |
* represented in degrees with values ranging from 0 to 360. | |
* |
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
// http://www.html5rocks.com/en/tutorials/es6/promises/ | |
function get(url) { | |
// Return a new promise. | |
return new Promise(function(resolve, reject) { | |
// Do the usual XHR stuff | |
var req = new XMLHttpRequest(); | |
req.open('GET', url); | |
req.onload = function() { |
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
def download_file(url): | |
local_filename = url.split('/')[-1] | |
# NOTE the stream=True parameter | |
r = requests.get(url, stream=True) | |
with open(local_filename, 'wb') as f: | |
for chunk in r.iter_content(chunk_size=1024): | |
if chunk: # filter out keep-alive new chunks | |
f.write(chunk) | |
f.flush() | |
return local_filename |
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
package main | |
import( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
"regexp" | |
) |