Skip to content

Instantly share code, notes, and snippets.

@coyotte508
coyotte508 / test.py
Last active December 31, 2015 10:39
#pythran export run()
def init(x):
global a
a = x
def show():
print(a)
def run():
@coyotte508
coyotte508 / gist:7744420
Created December 2, 2013 03:12
Server release

Release for Servers

This new release is a major release for server owners. We had problems with crashes -- between other things --, and so we did an overhaul of the way things were done.

There are two major changes:

  • The database system was completely changed. No more using SQL, instead text files in a folder named "serverdb".
  • Battles are in a separate process, a "battle server". Essentially means no crashes and hot updates.
@coyotte508
coyotte508 / gist:7506961
Created November 16, 2013 23:44
List image sizes in current dir
find ./* -prune -type f -name "*.png" -exec convert {} -print "{}=%wx%h\n" /dev/null \;
git rev-list master | while read rev; do git ls-tree -lr $rev | cut -c54- | grep -v '^ '; done | sort -u | perl -e '
while (<>) {
chomp;
@stuff=split("\t");
$sums{$stuff[1]} += $stuff[0];
}
print "$sums{$_} $_\n" for (keys %sums);
' | sort -rn >> large_files.txt
git filter-branch --tree-filter 'rm -rf `cat /full/path/to/large_files.txt | cut -d " " -f 2` ' --prune-empty <BRANCHES>
diff --git a/pythran/pythonic++/modules/math.h b/pythran/pythonic++/modules/math.h
index 1701f47..df1f189 100644
--- a/pythran/pythonic++/modules/math.h
+++ b/pythran/pythonic++/modules/math.h
@@ -1,6 +1,8 @@
#ifndef PYTHONIC_MODULE_MATH_H
#define PYTHONIC_MODULE_MATH_H
+#include <gmpxx.h>
+
@coyotte508
coyotte508 / gist:4283941
Created December 14, 2012 09:15
tier crash
coyotte@ns220747:~/alpha/bin$ gdb -p 23287
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>.
@coyotte508
coyotte508 / gist:4278752
Created December 13, 2012 19:01
how to log a battle
BattleOld=Battle;
Battle = function Battle() {
var self = this, run, getPoke;
BattleOld.apply(self, arguments);
run = self.run;
self.run = function(str, preempt) {
console.log("run: " + str); run.apply(self,arguments);
};
getPoke = self.getPokemon;
@coyotte508
coyotte508 / gist:4256786
Created December 11, 2012 08:13
battle log
soundManager.createSound(): Audio support is not available.
soundManager.createSound(): Audio support is not available.
runMajor args: ["join","niffirgj"], kwargs: {},preempt: undefined
runMajor args: ["join","AlphonseE"], kwargs: {},preempt: undefined
runMajor args: ["player","p1","niffirgj","170"], kwargs: {},preempt: undefined
runMajor args: ["player","p2","AlphonseE","76"], kwargs: {},preempt: undefined
runMajor args: ["gametype","singles"], kwargs: {},preempt: undefined
runMajor args: ["tier","OU"], kwargs: {},preempt: undefined
runMajor args: ["rated"], kwargs: {},preempt: undefined
@coyotte508
coyotte508 / gist:4169697
Created November 29, 2012 15:11
Old NB RPG script
//Record
//Check
//Save
//Reload
//Switch
//Show
//ShowTeam
//Pokedex
//Commands
//HelpMe
@coyotte508
coyotte508 / gist:3102488
Created July 13, 2012 03:21
Removes background from RBY images
find . -name "*.png" -exec convert '{}' -bordercolor white -border 1x1 -fill none -draw 'matte 0,0 floodfill' -shave 1x1 '{}' \;
(since the images themselves contained white, a simple replace wouldn't have been good)