Skip to content

Instantly share code, notes, and snippets.

@kevonc
kevonc / gist:5960201
Last active December 19, 2015 13:09
useful gems for rails development
group :development, :test do
gem 'pry-rails' # Causes rails console to open pry
# https://github.com/rweng/pry-rails
gem 'pry-debugger' # Adds step, next, finish, and continue commands and breakpoints
# https://github.com/nixme/pry-debugger
gem 'pry-stack_explorer' # Navigate the call-stack
# https://github.com/pry/pry-stack_explorer
gem 'annotate' # Annotate all your models, tests, fixtures, and factories
# https://github.com/ctran/annotate_models
gem 'quiet_assets' # Turns off the Rails asset pipeline log
@kevonc
kevonc / gist:6222682
Last active December 21, 2015 00:48 — forked from tibbon/gist:6222633
easy infinite scroll
$(window).scroll(function() {
// Cache our jQuery selector for window
var win = $(window);
// Infinite scroll math!
if(win.height() + win.scrollTop() >= $(document).height()) {
populateCountries();
}
});
<!DOCTYPE html>
<html>
<head>
<title>Backbone.JS-powered Blog</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<!-- This will be our main container -->
@kevonc
kevonc / gist:6913337
Created October 10, 2013 05:09
A Style Guide for README files
# README-README: A Style Guide for README files
## Contents
The `README.md` file and supporting documents should describe the following, in this order. If the file starts getting long, break it into pieces
* **Project Titles** as a level-1 heading
- with descriptive tagline: I should be informed and intrigued. Examples:
- "Sinatra is a DSL for quickly creating web applications in Ruby with minimal
effort"
@kevonc
kevonc / gist:7766779
Created December 3, 2013 09:55
Reset CSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@kevonc
kevonc / gist:8001700
Last active April 24, 2016 13:52
Config to open sublime text 2 in terminal, in the root directory (OS X El Capitan)
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
@kevonc
kevonc / .bash_profile
Last active April 24, 2016 13:52
To pretty up the terminal prompt, edit ~/.bash_profile.
# Change from zsh to bash
chsh
change /bin/zsh to /bin/bash
# .bash_profile
# Exports
# =======
# Make sublime our editor of choice
@kevonc
kevonc / gist:8415303
Created January 14, 2014 09:00
Prevent SSH connection from freezing
add the following lines to ~/.ssh/config
ServerAliveCountMax 3
ServerAliveInterval 10

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@kevonc
kevonc / gist:9247032
Last active August 29, 2015 13:56
a list of useful sublime packages
"AlignTab",
"BeautifyRuby",
"Block Cursor Everywhere",
"BracketHighlighter",
"CTags",
"Decent Color Scheme",
"Git",
"GitGutter",
"Haml",
"Neon Color Scheme",