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
float accumlatedTime=0; | |
Sprite cow; | |
float runSpeed = 1; # in pixels per second | |
float fallingAccelleration = 0.3; # how fast the fall should reach topspeed plummeting. | |
float maxFallVelocity = 3.0; # Should not be able to fall faster than 3px/s | |
onFrame(float deltaTime): | |
accumulatedTime + = deltaTime; | |
# Timestamp when a jump reached it's peak height and you're scheduled with a romantic date with gravity. |
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
PATH | |
remote: ../tumblargh | |
specs: | |
tumblargh (0.2.2) | |
activesupport (>= 3.1) | |
api_cache | |
nokogiri | |
treetop | |
GEM |
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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js"></script> | |
<script type="text/javascript"> | |
var app = angular.module('app',['ng']); | |
app.controller('MainCtrl', function($scope){ | |
}); |
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 Array | |
def groups_of(s) | |
resp = [] | |
g=[] | |
self.each do |i| | |
g << i | |
if g.count == s | |
resp << g | |
g= [] | |
end |
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
# Really short hash, (no extra collisions besides the known CRC32 ) | |
# Correct term for this encoding should be "Trimmed Urlsafe Base Encoded CRC32 Hash" or TUBECH?.. two-bitch encoding, lol. | |
# String.send(:include , ShortHash) | |
# "Hello World".short_hash # => "VrEXSg" | |
module ShortHash | |
require 'base64' | |
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
Element.getTransform= function (element){ | |
var properties = [ | |
'transform', | |
'WebkitTransform', | |
'MozTransform', | |
'msTransform', | |
'OTransform' | |
]; | |
var p; | |
while (p = properties.shift()) { |
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
module GravatarHelper | |
def gravatar_tag(email,*args) | |
opts = args.extract_options! | |
opts[:class]||="" | |
opts[:class]+=" gravatar" | |
size = opts.delete(:size) || 80 | |
require 'digest/md5' | |
default="" |
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
module Raumod::BufferMapper | |
# See http://ruby-doc.org/core/classes/String.html#M001112 | |
# for map types. | |
def data_map;@data_map;end | |
def data;@data;end | |
def data_entry(method) | |
offset = data_map[method][:offset] | |
type = data_map[method][:type] | |
d = data[offset..-1].unpack(type) |
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(){ // Wrap everything up in a function | |
var count,person; // These become private to this wrapped scope, and do not clutter the global namespace. | |
count=0; // Modify private count var, | |
person= function(name){ | |
this.name = name; | |
count++; |
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
/** | |
* Suppress mouse events if they hit panel with id "glassPane" | |
* unless a MouseDragged gesture is in process to ensure that every MouseClickedEvent that hits | |
* will be followed by an MouseReleasedEvent even if it's coords do not overlap any other nifty elements. | |
*/ | |
private final JoglInputSystem inputSystem = new JoglInputSystem() { | |
boolean niftyBusy=false; | |
@Override | |
public void mouseDragged(MouseEvent mouseEvent) { |
OlderNewer