Skip to content

Instantly share code, notes, and snippets.

View StanBoyet's full-sized avatar

Stanislas Boyet StanBoyet

View GitHub Profile
@StanBoyet
StanBoyet / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
def generate_random_string(length)
rand(36**length).to_s(36)
end
DISABLED_TASKS = [
'db:drop',
'db:migrate:reset',
'db:schema:load',
'db:seed',
# ...
]
namespace :db do
desc "Disable a task in production environment"

$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Solved by :

rm /usr/local/var/postgres/postmaster.pid

@StanBoyet
StanBoyet / Rakefile
Last active August 29, 2015 14:19 — forked from barrettclark/Rakefile
require 'rake'
# http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html
require 'net/http'
desc "this is a test"
task :testing_rake do
puts "Hello from rake!"
end
namespace :remote_file do
@StanBoyet
StanBoyet / get_pg_db.md
Last active December 17, 2015 10:13 — forked from kagemusha/gist:1569836
Dump Heroku Postgres DB and load locally
@StanBoyet
StanBoyet / gist:0b23d695164f2125dfdf
Created November 12, 2015 19:36 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@StanBoyet
StanBoyet / mysql_installation_error.md
Created November 25, 2015 11:11
ERROR: Error installing mysql: ERROR: Failed to build gem native extension

Another way for MacOS users

If you used "brew" to install mysql:

gem install mysql2 -v 'x.x.x' -- --with-mysql-config=/usr/local/Cellar/mysql/y.y.y/bin/mysql_config

x.x.x = version of the mysql2 gem you want to install