Skip to content

Instantly share code, notes, and snippets.

View chazu's full-sized avatar
🚀

Chaz Straney chazu

🚀
View GitHub Profile
<%= form_tag :controller => :main, :action => :pick %>
<%= hidden_field_tag 'var', @var %>
<%= button_to "again!", main_pick_path,{:method => :post} %>
@chazu
chazu / gist:1394557
Created November 25, 2011 22:25
Vector Math - Unable to Scale Unit Vector using numpy array
from numpy import array
class Flying_Circus:
def __init__(self):
self.unit_vector = array([1, 0, 0])
self.rate = 100
from unicurses import *
stdscr = initscr()
refresh()
user_input = getch()
if user_input == KEY_F:
print("Huzzah!")
@chazu
chazu / CSS!
Created February 5, 2012 19:23
.left_column {
float: left;
border: 1px solid red;
width: 500px;
}
.list_item {
float: left;
@chazu
chazu / game.rb
Created May 25, 2012 14:09
Trouble setting default values using a method called by the before_create hook...
class Game < ActiveRecord::Base
before_create :init
attr_accessible :length, :text
def init
self.text = ""
self.length = Random.rand(99) + 1
end
~/apps/eirenerx_messaging master $ bundle
There was a LoadError while evaluating warm_gum.gemspec:
cannot load such file -- sinatra/base from
/Users/thing5/apps/warm_gum/warm_gum.gemspec:3:in `<main>'
Does it try to require a relative path? That doesn't work in Ruby 1.9.
@chazu
chazu / gist:4186566
Created December 2, 2012 02:05
Singletons inheriting?
class Component(object):
"""
"""
def __init__(self):
"""
"""
self.components = []
self.behaviors = []
pass
@chazu
chazu / gist:5206965
Last active December 15, 2015 05:09
My xmonad.hs
import XMonad
import XMonad.Config.Desktop
import XMonad.Util.EZConfig
import XMonad.Actions.GridSelect
main = xmonad desktopConfig { terminal = "konsole" }
`additionalKeys`
[((ModMask, xK_g ), goToSelected DefaultGSConfig)
]
#include <stdio.h>
class App {
public:
App(float *vertices[]);
~App();
static float data[9] = {0.0, 1.0, 0.0,
-1.0, -1.0, 0.0,
#include <stdio.h>
class App {
public:
App();
~App();
int myGflwInit(void);