Skip to content

Instantly share code, notes, and snippets.

require 'chingu'
class Player < Chingu::GameObject
def initialize
super
self.x, self.y = 200, 200
self.image = Gosu::Image["ship1.jpg"]
self.input = {
/*
* Load external modules and init variables
*/
var twitter = require('ntwitter'),
http = require('http'),
bitly = require('bitly'),
b = new bitly('USER', 'API_KEY'),
tweeted = {},
load_time = Math.round(new Date().getTime() / 1000),
score_threshold = 100;
@wbyoko
wbyoko / htmlprocessor.snippets.js
Created February 27, 2013 20:21
These are snippets of code i'm using to swap out development versions of scripts to prebuilt mins that are in the same directory if available. this code is added to htmlprocessor.js in the grunt-usemin plugin ~ node_modules/grunt-usemin/lib/htmlprocessor.js
<!-- place at ~line 3 -->
<!-- 'use strict'; -->
<!-- var path = require('path'); -->
<!-- start include -->
var fs = require('fs');
var useMinIfAvailable = function (filePath) {
var minFilePath = filePath.replace(/(\.js|\.css)$/g,'.min$1');
if (fs.existsSync(minFilePath)) {
@wbyoko
wbyoko / parseDate.js
Created March 5, 2013 18:01
function to parse iso8601 dates in angular.
angular.module('parseDate', [])
.value('parseISO8601Date', function (s){
// from http://n8v.enteuxis.org/2010/12/parsing-iso-8601-dates-in-javascript/
// parenthese matches:
// year month day hours minutes seconds
// dotmilliseconds
// tzstring plusminus hours minutes
var re = /(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(\.\d+)?(Z|([+-])(\d\d):(\d\d))/;
@wbyoko
wbyoko / watcher.go
Created November 1, 2013 20:32
Watches url for text - used for nexus 5 updates
package main
import "fmt"
import "strings"
import "net/http"
import "bytes"
func pageContains(url string, checkFor string) bool {
resp, err := http.Get(url)
if err != nil {

Keybase proof

I hereby claim:

  • I am wbyoko on github.
  • I am wbyoko (https://keybase.io/wbyoko) on keybase.
  • I have a public key ASC0xbHJoXxRPMA_bIMoUTGsaKLm5gOyDS98PG2nbeS0Ywo

To claim this, I am signing this object: