create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
find . -name "*.haml" | while read i; do haml -f xhtml -q "$i" "${i%.*}.html"; done |
# Public: A module to be mixed in another class with common methods to index | |
# records in ElasticSearch. | |
# | |
# The host object needs to respond to 'indexed_attributes', which will return | |
# an array of the attributes names to be indexed. | |
# | |
# It's also recommended to override the 'save?' method to make sure only | |
# records that match some specifications are indexed. | |
# | |
# The type used for the ElasticSearch index will be extracted from the name of |
Having a buckload of code to authorize users on your application is something you may like or not.
Speaking for myself I hate it. But I still love rails_admin
, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.
do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
# this monit config goes in /etc/monit/conf.d | |
check process puma_master | |
with pidfile /data/myapp/current/tmp/puma.pid | |
start program = "/etc/monit/scripts/puma start" | |
stop program = "/etc/monit/scripts/puma stop" | |
group myapp | |
check process puma_worker_0 | |
with pidfile /data/myapp/current/tmp/puma_worker_0.pid |
#!/usr/bin/env ruby | |
# Credits to : | |
# http://stackoverflow.com/questions/16365553/creating-gist-from-a-ruby-script | |
# i modified the script alittle bit to read files from params | |
require 'net/http' | |
require 'json' | |
uri = URI("https://api.github.com/gists") |
#!/usr/bin/env ruby | |
# generate a single sentence from a canonical form | |
# canonical sentence is a multi sentences combined in one | |
# form, generator will generate a sentence from it randomly | |
# based on the form, for example: | |
# "Hello [Emad|Elsaid]" , may generate "Hello Emad" or | |
# "Hello Elsaid" the result is random. | |
# also you could nest [] inside each other to gain a multi level | |
# canonical sentence example: | |
# "[[Hi|Hello] [Emad|elsaid] | good [morning|night] sir]" |
#!/usr/bin/env ruby | |
# gem install sinatra --no-document | |
# gem install github-markdown --no-document | |
require 'sinatra' | |
require 'github/markdown' | |
set :port, 3000 | |
get '/' do | |
<<-EOT | |
<!DOCTYPE html> |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger