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
# see http://forums.kleientertainment.com/topic/33321-how-to-get-decoded-save-game-files/ | |
from base64 import b64decode | |
from sys import argv | |
from os import path | |
if __name__ == '__main__': | |
if len(argv)>1: | |
try: open(path.join(path.dirname(path.realpath(argv[0])),'my_output_file.txt'),'w').write(b64decode(open(argv[1], 'rb').read()[11:])[16:].decode('zlib')) | |
except Exception, e: print(e) |
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
function getScript(src, func) { | |
var script = document.createElement('script'); | |
script.async = "async"; | |
script.src = src; | |
if (func) { | |
script.onload = func; | |
} | |
document.getElementsByTagName("head")[0].appendChild( script ); | |
} |
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
/** | |
* NOTE: | |
* 1. alter return value will affect internal cache | |
* 2. `uniq` implementation may cause memory leak. try WeakMap? | |
*/ | |
/** | |
* @return {string} unique arguments identifier | |
*/ | |
function uniq() { |
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
{"title":"A New Hope","episode_id":4,"opening_crawl":"It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....","director":"George Lucas","producer":"Gary Kurtz, Rick McCallum","release_date":"1977-05-25","characters":["http://swapi.co/api/people/1/","http://swapi.co/api/people/2/","http://swapi.co/api/people/3/","http://swapi.co/api/people/4/","http://swapi.co/api/people/5/","http://swapi.co/api/people/6/","http://swapi.co/api/people/7/","http://swapi.co/api/people/8/","http://swapi.co/api/people/9/","http://swa |
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
#! /usr/bin/env node | |
'use strict'; | |
var app = require('koa')(); | |
var port = 8080; | |
app.use(function* () { | |
console.log(this.url); | |
this.status = 200; | |
this.body = 'Hello World!'; | |
}); |
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
(defproject vote "0.1.0-SNAPSHOT" | |
:description "FIXME: write this!" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[org.clojure/clojurescript "0.0-2755"] | |
[figwheel "0.2.2-SNAPSHOT"] | |
[org.clojure/core.async "0.1.346.0-17112a-alpha"] |
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 sys | |
import urlparse | |
import operator | |
""" | |
Parse url and group them by path | |
""" | |
filename = sys.argv[1] | |
if not filename: | |
print "Usage group.py <file path>" |
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
function decorate(decorator, decorated, context) { | |
return function() { | |
decorated.apply(context, decorator.apply(this, arguments)); | |
}; | |
} |
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/bash | |
TMPFILE="$1-${RANDOM}.bak" | |
mv $1 $TMPFILE | |
mv $2 $1 | |
mv $TMPFILE $2 |