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
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
#!/usr/bin/php | |
<?php | |
/** | |
* Calibration: depending on your fonts and terminal colors, you may want to change these | |
*/ | |
global $PIXELS, $COLORS, $HSV_COLORS; | |
$YSCALE = 12; | |
$XSCALE = 5; |
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($) { | |
var TOUCH_START = 'touchstart'; | |
var TOUCH_MOVE = 'touchmove'; | |
var TOUCH_END = 'touchend'; | |
var num_touch_points = function(e) { | |
var o = e.originalEvent; | |
if (o.hasOwnProperty('touches')) { | |
return o.touches.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
$.prototype.attrs = function(attr) { | |
var o = []; | |
$(this).each(function() { | |
var v = $(this).attr(attr); | |
if (v) { | |
o.push(v); | |
} | |
}); | |
return o; | |
} |
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 | |
class Accessible { | |
const inst_prefix = 'inst_'; | |
const stat_prefix = 'stat_'; | |
const trans_prefix = 'trans_'; | |
private $data = array(); |
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($) { | |
var default_prefs = { | |
"active_index" : 0, | |
"active_class" : 'active' | |
}; | |
var prefs = {}; | |
var methods = { | |
"init" : function(_prefs) { | |
var that = this; |
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
// BEM mixins (Block, Element, Modifier) | |
// | |
// Just google if you're confused. | |
@mixin block($name) { | |
@at-root .#{$name} { | |
@content; | |
} | |
} |
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
This is a mac specific script to load a mod into minecraft. In the terminal, run: | |
./mc_modloader.sh ModName.zip. | |
It will make a backup of your current minecraft jar, and attempt to merge the mod into it. |
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
#This file lists a bunch of callbacks for file changed events. | |
#@ /Users/raym/Sites/myon/includes/content/js/reader/player.3.2.js | |
java -jar $HOME/Sites/myon/server/utils/rm/lib/yuicompressor-2.4.7.jar /Users/raym/Sites/myon/includes/content/js/reader/player.3.2.js -o /Users/raym/Sites/myon/includes/content/js/reader/player.min.3.2.js; | |
echo "Hello world"; | |
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 calculate_line($x1, $y1, $x2, $y2, $dataset) { | |
$m = ($y2 - $y1) / ($x2 - $x1); | |
$b = ($y1 - $m * $x1); | |
$total_diff = 0; | |
foreach ($dataset as $inf) { | |
list($x, $y) = $inf; | |
$yl = $m * $x + $b; | |
$diff[$x] = $yl - $y; | |
$total_diff += abs($diff[$x]); |
NewerOlder