This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
package com.cascadegames.androidgame; | |
import android.util.Log; | |
import jgame.JGObject; | |
public abstract class GameObject extends JGObject { | |
AndroidGame g; | |
double gravity = 0.9; | |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/bin/bash | |
if [ ! -r "$1" ]; then | |
echo "Please provide a valid file." | |
exit 0 | |
fi | |
file="$(<$1)" | |
length="${#file}" | |
speed=4 | |
char_count=0 |
#!/usr/bin/env python2 | |
# do: ./noise.py | aplay -c 2 | |
# edited: speed up until too fast | |
import sys | |
import math | |
import random | |
TEMPO=1000 | |
def p(i): |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function (callback) { | |
window.setTimeout(callback, 1000 / 60); | |
}; | |
})(); |
<?php | |
// By Kaeru~ | |
require('lib/common.php'); | |
$sql = new mysql; | |
if(!@$sql->connect($sqlhost,$sqluser,$sqlpass)) | |
{ | |
mysqlerror(); | |
} |
package main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
func fibonacciCalculator() func(n int) *big.Int{ | |
cache := map[int]*big.Int{ | |
0: big.NewInt(0), |
own_window yes | |
own_window_transparent yes | |
own_window_argb_visual yes | |
own_window_type normal | |
own_window_class conky-semi | |
own_window_argb_value 40 | |
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager | |
format_human_readable yes | |
double_buffer yes | |
background yes |
#!/usr/bin/php | |
<?php | |
if (empty($argv[1])) { | |
die("please specify a file\n"); | |
} | |
function is_str($word) { | |
return preg_match('%^".*"$%', $word); | |
} |
#!/usr/bin/php | |
<?php | |
class Gasm { private $code = []; private $pc = 0; private $code_start = 0; private $code_len = 0; private $vars = []; private $labels = []; private $stack = []; private $comparison = false; private function line_number() { return 1 + $this->code_start + $this->pc; } private function strip_comments($line) { return trim(preg_replace('%;(.*)$%m', '', $line)); } private function is_label ($line) { return substr($line, -1) === ':'; } private function parse_line($line) { return array_map('trim', preg_split('%\s%', $line, 2)); } private function parse_args($args) { return array_map('trim', preg_split('%,%', $args)); } private function eval_expression($exp) { $matches = []; $ops = [ '+' => function ($a, $b) {return $a + $b;}, '-' => function ($a, $b) {return $a - $b;}, '*' => function ($a, $b) {return $a * $b;}, '/' => function ($a, $b) {return $a / $b;}, '%' => function ($a, $b) {return $a % $b;}, ]; $literals = [ '\n' => "\n", '\t' => "\t" ]; $ifx = '/(\w+)\s*(['.preg_quote(implode('', array_ke |