Skip to content

Instantly share code, notes, and snippets.

@corysimmons
corysimmons / retina.styl
Created March 11, 2015 13:15
Stylus Retina Mixin
retina(file, ext)
background-image: url(file'.'ext)
@media (-webkit-min-device-pixel-ratio: 2),
( min--moz-device-pixel-ratio: 2),
( -o-min-device-pixel-ratio: 2/1),
( min-device-pixel-ratio: 2),
( min-resolution: 192dpi),
( min-resolution: 2dppx)
background-image: url(file'@2x.'ext)
background-size: cover
stylus:
compress: true
path: ./path/to/styl
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"quotes": "double",
@corysimmons
corysimmons / user-settings.json
Created October 14, 2014 23:01
My Sublime Text user settings
{
"auto_complete": false,
"autocomplete_commit_on_tab": false,
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": true,
"color_scheme": "Packages/User/dark-pastel (SL).tmTheme",
"create_window_at_startup": false,
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
@corysimmons
corysimmons / uri.js
Created August 24, 2014 15:27 — forked from jlong/uri.js
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"
@corysimmons
corysimmons / emmet-stylus.md
Created August 23, 2014 01:13
Sublime Text settings for Emmet to render Stylus according to community backed conventions
{
  "preferences": {
    "stylus.valueSeparator": ": ",
    "stylus.propertyEnd": ""
  }
}
@corysimmons
corysimmons / ui.md
Created August 22, 2014 13:36
UI kit reqs
  • grid
  • buttons
  • input
  • textarea
  • graphs
  • tables
  • typography
    • lead
    • blockquotes
  • labels
var fuzzyList = new List('available-number-list', {
valueNames: ['num'],
plugins: [ListFuzzySearch()]
});
@corysimmons
corysimmons / tabs.html
Created August 14, 2014 15:23
jQuery Tabs without 10k characters
<nav class="tabs-nav">
<button data-target-tab="tab-1">Area Code</button>
<button data-target-tab="tab-2">Location</button>
<button data-target-tab="tab-3">Toll Free</button>
</nav>
<div class="tab-content" data-tab="tab-1">
area code
</div>
<div class="tab-content" data-tab="tab-2">
/*! jQuery UI - v1.11.1 - 2014-08-14
* http://jqueryui.com
* Includes: core.js, widget.js, tabs.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var a,n,o,r=t.nodeName.toLowerCase();return"area"===r?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(o=e("img[usemap='#"+n+"']")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,a=t?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.p