Skip to content

Instantly share code, notes, and snippets.

@hellosmithy
hellosmithy / no-cors
Created December 12, 2013 11:45
Open Chrome with CORS disabled for testing
open -a Google\ Chrome --args --disable-web-security
@hellosmithy
hellosmithy / SublimeText_Packages.md
Last active November 26, 2015 18:05
Useful SublimeText3 Packages
@hellosmithy
hellosmithy / box-sizing.styl
Created November 21, 2012 17:29
* { box-sizing: border-box } FTW (Stylus)
// Vendor mix-in for box-sizing
// assumes use of vendor interpolation
// http://learnboost.github.com/stylus/docs/interpolation.html
box-sizing()
vendor('box-sizing', arguments)
// apply a natural box layout model to all elements
*
@hellosmithy
hellosmithy / Preferences.sublime-settings
Last active October 13, 2015 02:27
Sublime Text user settings
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"bold_folder_labels": true,
"detect_indentation": true,
"dictionary": "Packages/Language - English/en_GB.dic",
"ensure_newline_at_eof_on_save": true,
"font_size": 17.0,
"reveal-on-activate": true,
"tab_size": 4,
"theme": "Soda Light 3.sublime-theme",
@hellosmithy
hellosmithy / transparency.styl
Last active September 30, 2015 10:18
Cross-browser alpha transparent background CSS (rgba) Stylus mixin
// background transparency
background-transparency(color, alpha = 1)
ms-color = argb(color, alpha)
background rgb(color)
background rgba(color, alpha)
.lt-ie8 &
zoom 1
.lt-ie9 &
background transparent
filter s('progid:DXImageTransform.Microsoft.gradient(startColorstr=%s,endColorstr=%s)', ms-color, ms-color)
@hellosmithy
hellosmithy / countries.html
Created July 7, 2011 10:20
An HTML form select input with countries compatible with Campaign Monitor naming conventions.
<select>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antigua &amp; Barbuda">Antigua &amp; Barbuda</option>
<option value="Argentina">Argentina</option>
@hellosmithy
hellosmithy / rebase
Created June 15, 2015 13:47
git rebase
$ git rebase -i HEAD~4
pick 01d1124 Adding license
pick 6340aaa Moving license into its own file
pick ebfd367 Jekyll has become self-aware.
pick 30e0ccb Changed the tagline in the binary, too.
# Rebase 60709da..30e0ccb onto 60709da
#
# Commands:
@hellosmithy
hellosmithy / serialize_data_override.js
Created July 28, 2014 14:26
Marionette `serializeData` override
serializeData: function() {
// call the original
var data = Marionette.View.prototype.serializeData.apply(this, arguments);
// add new data
data.whatever = myChannel.request('whatever');
return data;
}
@hellosmithy
hellosmithy / unload.js
Created July 1, 2014 13:05
Mobile Safari image unload
// Credit to: http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/
var img = document.getElementById('previous');
img.parentNode.removeChild(img);
img.src = 'data:image/gif;base64,' +
'R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
window.timeout(function() {
img = null;
}, 60000);
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"annotations": {