Skip to content

Instantly share code, notes, and snippets.

View maclover7's full-sized avatar

Jon Moss maclover7

View GitHub Profile
namespace :claide do
task :namespace do
files = Dir.glob('lib/bundler/vendor/CLAide*/**/*.rb')
sh "sed -i.bak 's/CLAide/Bundler::CLAide/g' #{files.join(' ')}"
sh "rm #{files.join('.bak ')}.bak"
end
task :clean do
files = Dir.glob('lib/bundler/vendor/CLAide*/*', File::FNM_DOTMATCH).reject { |f| %(. .. lib).include? f.split('/').last }
puts files
@maclover7
maclover7 / gist:1f4b46d2c6a36555dba7
Created April 9, 2015 16:17
reverse engineer all the things
user[settings_attributes][auto_refresh_comments]
user[settings_attributes][expanded_comment_view]
SQLite3::SQLException: no such column: student_assignments.assignment_due_date: SELECT COUNT(*) FROM "student_assignments" WHERE "student_assignments"."student_id" = ? AND "student_assignments"."assignment_due_date" = 'Saturday, May 23'
Jons-MacBook-Pro-6% ruby jon.rb
/Users/jon/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize': SQLite3::SQLException: no such column: student_assignments.assignment_due_date: SELECT "student_assignments".* FROM "student_assignments" WHERE "student_assignments"."assignment_due_date" = ? (ActiveRecord::StatementInvalid)
from /Users/jon/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'
from /Users/jon/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'
from /Users/jon/code/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:258:in `block in exec_query'
from /Users/jon/code/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:497:in `block in log'
from /Users/jon/code/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /Users/jon/code/rails/activerecord/lib/active_record
# Line 80 in config/environments/production.rb
# Original: config.action_mailer.default_url_options = { host: => 'realfootball.herokuapp.com' }
config.action_mailer.default_url_options = { :host => 'realfootball.herokuapp.com' }
# Lesson.joins(:contents).where("contents.curriculum_id" = ?", "3280")
SELECT curriculum_id FROM Contents
WHERE curriculum_id IN
(SELECT curriculum_id FROM Contents
GROUP BY curriculum_id HAVING COUNT (curriculum_id) >1)
<!DOCTYPE html>
<html>
<head>
<title>Place Autocomplete</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
</head>
<body>
<input id="city-input" class="controls" type="text"
placeholder="Enter a location">
@maclover7
maclover7 / 1.md
Last active October 4, 2015 15:40
$ L=/usr/local/bin/flynn && curl -sSL -A "`uname -sp`" https://dl.flynn.io/cli | zcat >$L && chmod +x $L

$ sudo bash < <(curl -fsSL https://dl.flynn.io/install-flynn)

$ /sbin/modprobe zfs

sudo flynn-host init --init-discovery

@maclover7
maclover7 / 3.md
Last active October 4, 2015 15:42
$ sudo start flynn-host
$ sudo status flynn-host
# --> This command should include `flynn-host start/running`. If it says `stop/waiting` instead, check out the logs at `/var/log/upstart/flynn-host.log` for more information.