Skip to content

Instantly share code, notes, and snippets.

View DrewWeth's full-sized avatar

Drew Wetherington DrewWeth

View GitHub Profile
//
// Disclamer:
// ----------
//
// This code will work only if you selected window, graphics and audio.
//
// Note that the "Run Script" build phase will copy the required frameworks
// or dylibs to your application bundle so you can execute it on any OS X
// computer.
a = "123"
hash = { 1 => 'a',
2 => 'b',
3 => 'd'}
a = a.split('').each do |variable|
puts hash[variable.to_i]
end
class CreateMembersInOrgs < ActiveRecord::Migration
def change
create_table :members_in_orgs do |t|
t.integer :mio_id
t.integer :member_id
t.integer :org_id
t.timestamps
end
end
class Member < ActiveRecord::Base
has_many :members_in_orgs
has_many :orgs, :through => :members_in_orgs
end
class MembersInOrgs < ActiveRecord::Base
validates_uniqueness_of :member_id, scope: :org_id
belongs_to :orgs
belongs_to :members
end
#define UNECESSARY_CONSTANT 0
typedef struct node {
String value;
typedef struct node next;
} Node;
/*
value_to_index[] = Hash(String value, int count)
index_to_ref[] = Hash(int count, Node* reference)
/*
Pretend like Strings are actually a thing
*/
typedef struct node{
String value;
Node* next;
} Node;
// Inserts to the front of the list