Dreaming of Code

Below is a list of information that you may or may not find useful.

vi-cheetsheat

http://www.lagmonster.org/docs/vi.html

Git command: show last date that a specific file was committed

git log -1 --format=%cd file.txt

Auth Basic curl header

-H "Authorization: Basic {{Base64 Encoded <username:password>}}"

grep multiple strings recursively

grep -r 'string_1' . | grep 'string_2'

vi command: remove white space at end of line

:%s/\s\+$//

Curl header for auth basic

-H "Authorization: Basic <Base 64 encode username:password>"

example.com

http://example.com

A great url to use for examples

tidbit

a useful tidbit of information

How to get a bearer token for Facebook Graph api

https://graph.facebook.com/oauth/access_token?client_id={client_id}&client_secret={secret}&grant_type=client_credentials

Replace {client_id} and {secret} appropriately

git reset to specific commit

http://stackoverflow.com/questions/2389361/undo-a-git-merge

git reset --hard commit_sha

search through rails routes

http://natashatherobot.com/search-rails-routes/

example: rake routes | grep user

git diff shortstat

git diff --shortstat

Project specific gemsets for Rails

http://everydayrails.com/2010/09/13/rvm-project-gemsets.html

Specify gemset for project

rvm --ruby-version use 2.2.3@gemset

Ruby: to_bool

http://drawingablank.me/blog/ruby-boolean-typecasting.html

boolean typecasting

Multi database best practices

http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/

Threads and Rails

https://www.agileplannerapp.com/blog/building-agile-planner/rails-background-jobs-in-threads

Running rails background jobs in a thread

config.threadsafe!

http://tenderlovemaking.com/2012/06/18/removing-config-threadsafe.html

Good steps for Digital Ocean

https://gist.github.com/ChuckJHardy/f44dda5f94c6bbdba9a4

Create a rails/nginx/postgres/unicorn app on digital ocean

Rails nginx and passenger setup on ubuntu

https://gist.github.com/julionc/4006d5b2091496600fc2

Ajax start and stop events

http://stackoverflow.com/questions/2275342/jquery-ajaxstart-doesnt-get-triggered

load assets for specific action in Rails

javascript_include_tag "#{params[:controller]}_#{params[:action]}" and create file like so app/assets/javascripts/controller_action.js

CSS modal

http://jsfiddle.net/kumarmuthaliar/GG9Sa/1/

a jsfiddle for a simple css only modal

Responsive Highchart

http://jsfiddle.net/Behseini/qheh4w0n/