Skip to content

Instantly share code, notes, and snippets.

View danott's full-sized avatar
📈
Chart with upward trend

Dan Ott danott

📈
Chart with upward trend
View GitHub Profile

Ruby on Rails Interview Questions

Q1.

What is the difference between Ruby's Hash and ActiveSupport's HashWithIndifferentAccess?

Answer

The Hash class in Ruby's core library retrieves values by doing a standard ==

@jabronus
jabronus / slack-themes
Last active August 29, 2015 14:05
Slack Themes
Letterpress Dark:
#313131,#242424,#00BAFF,#FFFFFF,#187598,#FFFFFF,#00BAFF,#FF432F
Monument Valley:
#0D7E83,#076570,#F79F66,#FFFFFF,#D37C71,#FFFFFF,#F79F66,#F15340
Threes:
#FEFFFF,#CBE1DB,#66CCFF,#FFFFFF,#FFCC66,#494766,#FF6680,#FF6680
@MicahChalmer
MicahChalmer / .htaccess
Last active May 1, 2016 16:49
Scripts to set up Ruby 1.9.3 on a DreamHost shared hosting account via rbenv and ruby-build, and run a Rack app with it via FastCGI.
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
@meesterdude
meesterdude / README.md
Last active March 23, 2017 17:42
emoji_spec is a microgem to put emoji in your rspec output.

Emoji Spec

results Tired of the same, dull rspec output? liven it up with some emoji!

Below are the sets presently available, and their corresponding id. if you don't set an ID, one will be randomly chosen every run. Emoji icons may not render in certain terminals.

(pass, fail, pending)

emoji

@jrmoran
jrmoran / Cakefile
Created December 30, 2011 01:44
Cakefile to document, compile, join and minify CoffeeScript files for client side apps.
# Cakefile to document, compile, join and minify CoffeeScript files for
# client side apps. Just edit the config object literal.
#
# -jrmoran
fs = require 'fs'
{exec, spawn} = require 'child_process'
# order of files in `inFiles` is important
config =
@clm-a
clm-a / hash_checkboxes_rails.rb
Created March 22, 2012 11:48
Checkboxes for rendering an Hash in Rails
# file mood.rb
Mood = Struc.new(:happy)
# file user.rb
class User
serialize mood, Mood
def mood=(attr={})
@guilleiguaran
guilleiguaran / disable_framework.md
Created October 10, 2012 21:35
Disabling frameworks in Rails 3+

Disabling frameworks in Rails 3+###

Replace in your config/application.rb

require "rails/all"

with:

require "rails"
@igrigorik
igrigorik / gist:3148848
Created July 20, 2012 05:24
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@hkmix
hkmix / comments.vim
Created June 30, 2015 01:25
Vim theme for only colours, adapted from industry.vim
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "comments"
" First set Normal to regular white on black text colors:
hi Normal ctermfg=LightGray ctermbg=Black guifg=#dddddd guibg=Black
@tjogin
tjogin / README.md
Created September 5, 2011 06:56 — forked from rodrigorm/README.md
Configuration file to use PHP with Ruby rack

Installation

First you need php-cgi, i used brew with Formula below:

$ curl -O https://raw.github.com/gist/1194269/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb
$ mv php.rb `brew --prefix`/Library/Formula
$ brew install php --with-mysql

Second, install this ruby gems: