Skip to content

Instantly share code, notes, and snippets.


Michael Mahemoff mahemoff

View GitHub Profile
mahemoff / gist:8885615
Last active Aug 29, 2015
Dbpedia Ruby
View gist:8885615
# Using
# See also
# List of countries, including defunct countries
Dbpedia.sparql.query('select ?country where { ?country rdf:type dbpedia-owl:Country }')
# List of modern countries
select ?country where { ?country <> <>; <> <> } order by ?country
View gist:8918750
"Project Default Service Account" is what Google Plus calls default OAuth providers. As the developer, change it in the console under "Consent screen".
mahemoff / gist:8973559
Created Feb 13, 2014
Reference data in Linode API
View gist:8973559
# Setup
require 'pp'
require 'linode'
l = api_key: 'my-api-key' # Get that from
a = l.avail
# Let's Rock It ...
2.1.0 :011 > pp a.datacenters
mahemoff / linode
Created Feb 13, 2014
Ansible Linode module - changes to remove Linode ID name prefix, and to add private IP support.
View linode
# api.linode_update(LinodeId=linode_id, Label='%s_%s' % (linode_id, name))
api.linode_update(LinodeId=linode_id, Label='%s' % (name))
mahemoff / ask-wikipedia.rb
Last active Aug 29, 2015 — forked from emad-elsaid/ask-wikipedia.rb
Refactor processing, make script standalone with initial env, add command-line argument
View ask-wikipedia.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
language = 'en'
article = ARGV[0] ||
print 'What do you need to know? : '
URI::encode gets.chomp
mahemoff / gist:9214688
Created Feb 25, 2014
callbacks stacktrace
View gist:9214688
/Users/ruby/.rvm/gems/ruby-2.1.0/bundler/gems/rails-25a05723792b/activesupport/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method': undefined method `_compile_filter' for class `ActiveSupport::Callbacks::Callback' (NameError)
from /home/project/.rvm/gems/ruby-2.1.0/bundler/gems/rails-25a05723792b/activesupport/lib/active_support/core_ext/module/aliasing.rb:32:in `alias_method_chain'
from /home/project/demo/config/initializers/log_callbacks.rb:3:in `included'
from /home/project/demo/config/initializers/log_callbacks.rb:37:in `include'
from /home/project/demo/config/initializers/log_callbacks.rb:37:in `<top (required)>'
from /home/project/.rvm/gems/ruby-2.1.0/bundler/gems/rails-25a05723792b/activesupport/lib/active_support/dependencies.rb:241:in `load'
from /home/project/.rvm/gems/ruby-2.1.0/bundler/gems/rails-25a05723792b/activesupport/lib/active_support/dependencies.rb:241:in `block in load'
from /home/project/.rvm/gems/ruby-2.1.0/bundler/gems/rails-25a05723792b/activesupport/lib/active
mahemoff / unicorn
Last active Aug 29, 2015 — forked from ethier/gist:7190310
Update the upgrade function - it captures the old PID before it's overwritten by the upgrade (ie USR2 signal), then kills it once the upgrade has succeeded
View unicorn
# forked from
# via
### Unicorn variables ###
mahemoff / gist:9684727
Created Mar 21, 2014
Common Ansible ssh error
View gist:9684727
FAILED => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue
In my experience, this is almost because I forgot add the user. Add "-u username" to the ansible command-line call.
mahemoff / Github mail
Created Mar 26, 2014
Odd situation involving private legacy fork of public repo
View Github mail
Upcoming changes to your fork mahemoff/yeoman
12:50 AM (7 hours ago)
Dear mahemoff,
During recent maintenance we discovered that your private fork mahemoff/yeoman's parent repository yeoman/yeoman is public. We no longer allow the creation of private forks from public repositories, so we need to make some changes to your fork.
To protect your code's privacy we don't automatically make a fork public to match the parent repository. Instead, mahemoff/yeoman will be unforked in three days and become a new private repository under your account.
View index.html
<a href="">Accounting</a>
<a href="">Acoustic</a>
<a href="">Adventist</a>
<a href="">After Life</a>
<a href="">Agile</a>