Skip to content

Instantly share code, notes, and snippets.

@asmega
asmega / gist:3468ec8f4571cada07c2
Created September 21, 2014 20:18
pdf page extract
convert -density 300 odd.pdf\[0\] 0.pdf
@asmega
asmega / gist:d39cff367ee84e351eb4
Created January 18, 2015 12:08
Import Export Momento to Google Calendar via csv
require 'date'
class Event
attr_reader :title, :date, :time
def initialize(title, date, time)
@title = title
@date = date
@time = time
end
@asmega
asmega / gist:908eac85ad97c880190f
Created January 27, 2015 13:38
mass rename files
rename 's/.css.scss/.scss/g' *.css.scss
@asmega
asmega / gist:ae2c2ed73d9bb0f75df8
Created February 8, 2015 22:54
postgresql index on point column
CREATE INDEX ON establishments using gist (geo);
@asmega
asmega / gist:5ebb20b527296aa6ccab
Created May 12, 2015 10:19
import mysql database
mysql -u USERNAME -h 127.0.0.1 -p DB_NAME < FILE.SQL
@asmega
asmega / gist:05bc7d345e69b14e1a5b
Last active August 29, 2015 14:23
probable custom form builder
# code from nested form
module NestedForm
class Builder < ::ActionView::Helpers::FormBuilder
include ::NestedForm::BuilderMixin
end
end
####################
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install mysql
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1
1) Error:
test_the_truth(Admin::FilmControllerTest):
Mysql::Error: Access denied for user 'root'@'localhost' (using password: NO)
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
1) Error:
test_the_truth(Admin::FilmControllerTest):
Mysql::Error: Unknown database 'application_name_test'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'