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 getShortURL(url) | |
{ | |
return jQuery.ajax({ | |
'type': 'POST', | |
'url': "https://www.googleapis.com/urlshortener/v1/url", | |
'contentType': 'application/json', | |
'data': JSON.stringify({"longUrl" : url}), | |
'success': function(data){console.log(data.id)} | |
}); | |
} |
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
# usage: python itunes.py /Users/$USER/Music/iTunes/iTunes\ Music\ Library.xml | |
import plistlib | |
import sys | |
if len(sys.argv) > 1: | |
data = plistlib.readPlist(sys.argv[1]) | |
tracks = data["Tracks"] |
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
#include <math.h> | |
#include <stdio.h> | |
double my_atan(double x) | |
{ | |
//printf("%f\n", x); | |
return x - (x*x*x)/3 + (x*x*x*x*x)/5 - (x*x*x*x*x*x*x)/7 + (x*x*x*x*x*x*x*x*x)/9; | |
} | |
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 java.util.Arrays; | |
public class Java_BS | |
{ | |
public static void main(String[] args) | |
{ | |
// Declare Array | |
int[] A = {6,5,3,1,8,7,2,4}; | |
// Set length |
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
# imports | |
import random | |
# explain the game | |
print("Let's play a number guessing game.") | |
print("Think of a number between 1 and 1000, and I will try to guess it.") | |
# optimal first guess is 500 for 1 through 1000 | |
low_guess = 1 | |
high_guess = 1000 |
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 urllib | |
import sys | |
from lxml.html import fromstring | |
def usage(): | |
print("Usage: python mario.py [course id]") | |
print(" ex: python mario.py 3410-0000-0183-C4A2") | |
if len(sys.argv) < 2: | |
usage() |
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
ins = [ [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 12, 13, 12, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14 ], [ 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 2, 5, 12, 5, 2, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, |
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
class Whatever: | |
value = 0 | |
othervalue = 5 | |
def meth(self): | |
return 3 | |
def dothings(self, inp): | |
self.value = inp; | |
return self.othervalue | |
c = Whatever() |
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
class mrange: | |
def __init__(self, low, high): | |
self.low = low | |
self.high = high | |
def __contains__(self, value): | |
return value >= self.low and value <= self.high | |
a = mrange(3, 3924820948239749237439287423) | |
print 324729847 in a | |
print 2 in a |
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
<?php | |
require_once("wiiu_browserhax_common.php"); | |
if($sysver==532) | |
{ | |
$first_tx3g_size = 0x7800; | |
} | |
else if($sysver==550 || $sysver==540) | |
{ |