This file contains hidden or 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
/* | |
Pretend like Strings are actually a thing | |
*/ | |
typedef struct node{ | |
String value; | |
Node* next; | |
} Node; | |
// Inserts to the front of the list |
This file contains hidden or 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
#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) |
This file contains hidden or 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 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 |
This file contains hidden or 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 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 |
This file contains hidden or 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
a = "123" | |
hash = { 1 => 'a', | |
2 => 'b', | |
3 => 'd'} | |
a = a.split('').each do |variable| | |
puts hash[variable.to_i] | |
end |
This file contains hidden or 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
// | |
// 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. |
This file contains hidden or 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
// STEP 1: First import jQuery | |
// Here's a link to raw jQuery that can be copy/pasted into the console | |
// http://code.jquery.com/jquery-1.7.1.min.js | |
// NOTE: You have to have all the comments expanded first. | |
// STEP 2: copy/paste this. I'm not sure if #u_0_21 will work for everyone. | |
a = $('div > p:contains("Comment with your e-mail if you want $100")').parent().parent(); $('li div.UFICommentContent span.UFICommentBody', a).each(function(elem){ arr.push($(this).text()); });copy.log(arr); | |
This file contains hidden or 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
import java.lang.reflect.Array; | |
import java.util.ArrayList; | |
public class Main { | |
public Main(){ | |
} | |
public static void main (String[]args){ |
This file contains hidden or 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
# bin/phantomjs --webdriver=9999 | |
require 'selenium-webdriver' | |
require 'nokogiri' | |
require 'uri' | |
require 'json' | |
# supply video ID or full YouTube URL from command line | |
arg = ARGV[0] | |
if arg =~ /^#{URI::regexp}$/ |
This file contains hidden or 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
require 'open-uri' | |
require 'nokogiri' | |
starting_url = ARGV[0] | |
channel_ids=[] | |
video_urls=[] | |
temp=[] | |
url_string = "" | |
page_source = Nokogiri::HTML(open(starting_url)) | |
page_source.css("a").each do |url| |
OlderNewer