Skip to content

Instantly share code, notes, and snippets.

View danro's full-sized avatar
👀

Dan Rogers danro

👀
View GitHub Profile
@danro
danro / uri.js
Created February 23, 2013 03:03 — forked from jlong/uri.js
more href tricks
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@danro
danro / Boxfile
Created November 27, 2012 01:17
Reject pagodabox deploys with missing files
web1:
document_root: public
after_build:
- "ls public/dist/* &> /dev/null"
@danro
danro / 1-README.scss
Last active October 12, 2015 02:18
Sass 3.2 mixin for managing responsive breakpoints.
.selector-one {
@include respond-to(phone) {
// phone and below (because it's the smallest)
}
@include respond-to(desktop-up) {
// desktop and higher
}
@include respond-to(ultra) {
@danro
danro / iphone-media-queries.css
Created October 25, 2012 02:06
iphone media queries
/* iPhone 3 portrait */
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:portrait) {
}
/* iPhone 3 landscape */
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:landscape) {
}
/* iPhone 4 retina portrait */
@media (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:portrait) {
@danro
danro / gist:3837163
Created October 4, 2012 23:43
Lion / Mountain Lion font anti-aliasing tweak.
# Fix font smoothing on Lion / Mountain Lion [range: 0-3]
defaults -currentHost write -globalDomain AppleFontSmoothing -int 1
@danro
danro / Custom.css
Created September 16, 2012 17:32
Improved webkit inspector toolbar
#-webkit-web-inspector #toolbar {
background: #cdcdcd !important;
height: 36px !important;
}
#-webkit-web-inspector #main {
top: 36px !important;
}
#-webkit-web-inspector .toolbar-item.elements:hover:after {
content: "elements";
z-index: 9999;
@danro
danro / 1-mixin.scss
Created September 9, 2012 19:40
SCSS hover-active mixin
@mixin hover-active {
&:hover {
.no-touch & {
@content;
}
}
&:active {
.touch & {
@content;
}
@danro
danro / iterator.js
Created September 8, 2012 04:33
Javascript Iterator using underscore.js
// --------------------------------------------------
// Iterator with shuffle support
// --------------------------------------------------
define(function (require) {
// dependencies
var _ = require('underscore');
// default options
var defaults = {
@danro
danro / hidey.js
Created August 21, 2012 22:33
Faster jQuery hide / show
define(function (require) {
// dependencies
var $ = require('jquery');
// --------------------------------------------------
// jquery micro-plugin for faster hide/show
//
$.fn.hidey = function () {
return this.each(function () {
@danro
danro / easing.scss
Created August 16, 2012 21:43
SCSS easing equations
// Cubic
$easeInCubic: cubic-bezier(0.550, 0.055, 0.675, 0.190);
$easeOutCubic: cubic-bezier(0.215, 0.610, 0.355, 1.000);
$easeInOutCubic: cubic-bezier(0.645, 0.045, 0.355, 1.000);
// Circ
$easeInCirc: cubic-bezier(0.600, 0.040, 0.980, 0.335);
$easeOutCirc: cubic-bezier(0.075, 0.820, 0.165, 1.000);
$easeInOutCirc: cubic-bezier(0.785, 0.135, 0.150, 0.860);