Skip to content

Instantly share code, notes, and snippets.

View edward's full-sized avatar

Edward Ocampo-Gooding edward

View GitHub Profile
@edward
edward / gist:7214270
Created October 29, 2013 13:06
Running benchmarks of context-threaded Ruby vs. normal Ruby. ctruby build with regular ./configure and no special flags. Benchmarks performed on a MacBook Air mid-2011.
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
$ ./ruby -v
ruby 2.1.0dev (2013-10-23 trunk 43398) [x86_64-darwin13.0.0]
$ ruby benchmark/driver.rb --executables="normal_ruby::/opt/boxen/rbenv/shims/ruby; ctruby::/Users/edward/Code/C/ruby/ruby -Ilib:.:.ext/common:.ext/x86_64-darwin13.0.0/" --pattern='bm_' --directory=/Users/edward/Code/C/ruby/benchmark -r 5
preparing benchmark/fasta.output.100000
preparing benchmark/fasta.output.2500000
if ((rb_enc_asciicompat(to) && is_ascii_string(str)) ||
to == rb_ascii8bit_encoding()) {
if (STR_ENC_GET(str) != to) {
str = rb_str_dup(str);
rb_enc_associate(str, to);
}
return str;
}
@edward
edward / gist:6703348
Created September 25, 2013 17:49
Keyboard mapping things for OSX
Something that's bugged me about OS X's Terminal is its default key shortcuts: the home and end keys don't do what I expect, and holding ctrl+arrow keys don't skip around words (which is really useful once you get in the hang of it). Even "cmd" from Windows has these key behaviors. The fix: Check out /etc/inputrc and /etc/profile to make changes system-wide (of course, you can make this specfic to only your user account by using ~/.inputrc and ~/.bash_profile). This is my /etc/inputrc:
# Be 8 bit clean.
set input-meta on
set output-meta on
set convert-meta off
# allow the use of the Home/End keys
"\e[1~": beginning-of-line
"\e[4~": end-of-line
http://projectofhow.com/methods/negative-brainstorming/#
A method that uses brainstorming to generate bad solutions to the problem, and then see how those could be transformed into good solutions.
One way to generate ideas is to generate good solutions through brainstorming. Negative brainstorming takes a different angle on that. The method is a two-step process that consists of first generating the worst solutions to the problem then transforming them into good solutions. This can be a fun way to use brainstorming in a silly manner and solve problems from a different angle.
@edward
edward / gist:6430914
Last active December 22, 2015 06:28
GitHub workshop blurb

Interested in improving Shopify as a product / as a company? David and Edward are putting on a workshop to level up your Shopifier skillz with some new collaboration superpowers using GitHub and git.

This workshop is aimed at non-developers.

If you’re a top-down learner, read the next bit. If you’re a bottom-up learner, skip down.

Tell me of these super powers via top-down learning (Edward sez):

I was invited by Shopify to come and visit Ottawa for 3 Weeks while having a job-application there.

My homebase is the Les Suites Hotel in the city center.

It's the perfekt location to explore Ottawa, as it's close to the Byward Market, Ottawa River and the Rideau Canal.

I attached a couple of photos with dropbox.

Food & Drinks

class Bob
def hey(statement)
s = Statement.new(statement)
if s.is_silent?
'Fine. Be that way!'
elsif s.is_exclamatory?
'Woah, chill out!'
elsif s.is_interrogatory?
'Sure.'
puts (0..99).map {|i| srand(46308667) if (i%15).zero?; ["FizzBuzz", "Buzz", i+1, "Fizz"][rand(4)]}
# (create oauth2 tokens from Google Console)
client_id = ""
client_secret = ""
# (paste the scope of the service you want here)
# e.g.: https://www.googleapis.com/auth/gan
scope = ""
client = OAuth2::Client.new(API_CLIENT, API_SECRET, {
:authorize_url => 'https://accounts.google.com/o/oauth2/auth',
:token_url => 'https://accounts.google.com/o/oauth2/token',
# Set options that get passed on to Faraday
:connection_opts => {:proxy => { :uri => 'http://127.0.0.1:8888'} },
:ssl => {:verify => false}
})