Skip to content

Instantly share code, notes, and snippets.

@stammy
stammy / _media-queries.scss
Last active December 20, 2019 11:57 — forked from anthonyshort/_media-queries.scss
because you should be using ems for accessibility (zoom level) in your media queries
// $mq-mobile-portrait : 320px !default;
// $mq-mobile-landscape : 480px !default;
// $mq-tablet-portrait : 640px !default; -- changed because i want my blog content is around this wide, not 768. you should let content & design determine your breakpoints
// $mq-tablet-landscape : 1024px !default;
// $mq-desktop : 1382px !default;
$mq-mobile-portrait : 20em !default;
$mq-mobile-landscape : 30em !default;
$mq-tablet-portrait : 40em !default;
$mq-tablet-landscape : 64em !default;
@stammy
stammy / nginx.conf
Created December 29, 2012 11:41 — forked from phpdude/nginx.conf
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@stammy
stammy / high-dpi-media.scss
Created November 26, 2012 06:27 — forked from kimroen/high-dpi-media.scss
A Sass media query mixin that captures almost all high DPI aware devices.
/* ----------------------------------------------------------------------- */
/* */
/* Improved upon a mixin from 37signals and combined */
/* with these numbers from marc. */
/* */
/* 37signals-version: */
/* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */
/* */
/* @kimroen */
/* */
@stammy
stammy / _media-queries.scss
Created November 26, 2012 06:16 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@stammy
stammy / promises.md
Created October 22, 2012 06:08 — forked from domenic/promises.md
You're Missing the Point of Promises

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
});
@stammy
stammy / underscoreR.coffee
Created May 7, 2012 03:06 — forked from jimtla/underscoreR.coffee
Add CoffeeScript friendly argument order to Underscore.js
# Five lines of code that will make your underscore + CoffeeScript use cleaner.
# Creates an underscore function for each function in to_reverse with R (short for Reversed) appended to the name.
# The R version moves the function argument (first argument in normal underscore) to the end,
# so you can write:
$(window).scroll _.throttleR 500, ->
console.log "This print's at most every 500ms"
# Instead of:
$(window).scroll _.throttle ->
console.log "This prints at most every 500ms too"
@stammy
stammy / hack.sh
Created April 1, 2012 09:55 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@stammy
stammy / application_controller.rb
Created July 5, 2011 18:45 — forked from aliang/application_controller.rb
Force SSL on Devise routes only, then redirect back
class ApplicationController < ActionController::Base
# Tell Devise to redirect after sign_in
def after_sign_in_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
# Tell Devise to redirect after sign_out
def after_sign_out_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
@stammy
stammy / application_controller.rb
Created April 23, 2011 09:36 — forked from aliang/application_controller.rb
Force SSL on Devise routes only, then redirect back
class ApplicationController < ActionController::Base
# Tell Devise to redirect after sign_in
def after_sign_in_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
# Tell Devise to redirect after sign_out
def after_sign_out_path_for(resource_or_scope)
some_url(:protocol => 'http')
end
@stammy
stammy / .htaccess
Created December 31, 2010 04:28 — forked from henrik/.htaccess
RewriteEngine On
# Map http://henrik.nyh.se to /jekyll.
RewriteRule ^$ /jekyll/ [L]
# Map http://henrik.nyh.se/x to /jekyll/x unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/jekyll/
RewriteRule ^(.*)$ /jekyll/$1