Skip to content

Instantly share code, notes, and snippets.

View averyvery's full-sized avatar

Doug Avery averyvery

View GitHub Profile
@averyvery
averyvery / gist:1230799
Created September 21, 2011 00:11
aaaaawwwww shiiiiiitttttt
project_type = :rails
preferred_syntax = :scss
output_style = :expanded
http_path = "/"
relative_assets = true
line_comments = false
if Rails.env.development?
require 'ruby-growl'
@averyvery
averyvery / Guardfile
Created November 14, 2011 20:58
Resizing retina images with rmagick
guard 'process', :name => 'shrink-images', :command => 'ruby resize-mobile-images.rb' do
watch /^images\/mobileretina\/.+.png/
end
@averyvery
averyvery / Guardfile
Created November 17, 2011 18:48
Guardfile for mobile dev
guard 'compass' do
watch /^.+(\.s[ac]ss)/
end
guard 'process', :name => 'minify-screen-js', :command => 'juicer merge js/all.js -o js/all.min.js --force -s' do
watch /^js\/brianregan\/screen.js/
end
guard 'process', :name => 'minify-mobile-js', :command => 'juicer merge js/mobile.js -o js/mobile.min.js --force -s' do
watch /^js\/brianregan\/mobile.js/
@averyvery
averyvery / mobile.scss
Created November 29, 2011 22:09
Retina and non-retina backgrounds with Sass
@mixin mobile-sprite($selector, $image){
#{$selector} {
background-image: image-url('mobilenormal/' + $image);
}
@media only screen and (-webkit-min-device-pixel-ratio: 2){
#{$selector} {
$image_path: 'mobilenormal/' + $image;
background-image: image-url('mobileretina/' + $image);
background-size: image-width($image_path) image-height($image_path);
}
@averyvery
averyvery / .vimrc
Created December 13, 2011 06:20
Tweaked Vim minimap
function! ToggleMinimap()
if exists("s:isMini") && s:isMini == 0
let s:isMini = 1
else
let s:isMini = 0
end
if (s:isMini == 0)
@averyvery
averyvery / compass.rb
Created January 11, 2012 20:11
compass.rb for quanting sprites
require 'growl_notify'
GrowlNotify.config do |config|
config.notifications = ["Compass Application"]
config.default_notifications = ["Compass Application"]
config.application_name = "My Application"
end
http_path = '/'
css_dir = 'public/assets/stylesheets'
@averyvery
averyvery / css
Created March 21, 2012 15:49
Simple "todo" style
.TODO {
position: relative;
&:after {
background: rgb(250, 255, 185);
content: "";
display: block;
height: 23px;
left: 5px;
position: absolute;
top: 5px;
@averyvery
averyvery / Guardfile
Created March 21, 2012 17:11
Resizing 2x mobile images
guard 'process', :name => 'shrink-images', :command => 'ruby resize-mobile-images.rb mobileretina' do
watch /^images\/mobileretina\/.+/
end
@averyvery
averyvery / .vimrc
Created April 22, 2012 21:27
Navigating Indents in Vim
" Indent navigation in vim - https://gist.github.com/gists/2467046/
" Adapted from http://vim.wikia.com/wiki/Back_and_forth_between_indented_lines_again
" Use Option+hjkl to navigate to the start/end of indents, or move in/out of indented code
" Additionally, combine the actions <, >, d, and y with these four movements
" This is useful for quickly performing actions on functions, objects, anything that begins and ends with a matching indent level
"
" Examples:
" <opt-j> at a function's start moves to the end of the function
" ><opt-j> at a function's start indents the whole function another level.
" y<opt-k> at a function's end yanks the entire thing
@averyvery
averyvery / .vimrc
Created June 8, 2012 22:32
A few things I wish I'd done as soon as I started with Vim
" relative linenumber. very helpful for "8yy"-style operations
set relativenumber
" once you get used to virtualedit=all, it's so great
set virtualedit=all
" setting this allows you to undo into previous sessions, all the way back to the start of a file
" (providing the path hasn't changed).
" very useful with the Vundle plugin
set undofile