Skip to content

Instantly share code, notes, and snippets.

View asimpson's full-sized avatar

Adam Simpson asimpson

View GitHub Profile
@asimpson
asimpson / My Sublime Preferences
Created August 30, 2012 17:15
This is a simple copy and paste of my Sublime Text 2 preference file. Use whatever you want!
// Settings in here override those in "Default/Preferences.sublime-settings", and
// are overridden in turn by file type specific settings.
{
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
"detect_slow_plugins": false,
"draw_centered": false,
"fade_fold_buttons": false,
"font_face": "Menlo",
@asimpson
asimpson / validpopover.js
Created September 11, 2012 20:50
Validation + Popover
if( !Modernizr.formvalidation ){
var sb_formValidation = $('.content form, .search-container form, .support-search form');
H5F.setup(sb_formValidation);
$(sb_formValidation).find('[required]').popover({
placement:'bottom',
title:'Required!',
content:"Please fill out this field.",
@asimpson
asimpson / eventListener.js
Created September 12, 2012 14:11
eventListener IE8 and below
/* window.addEventListener( "resize", mmListener);
mmListener();*/
if (window.addEventListener) {
window.addEventListener("resize", mmListener);
} else if (window.attachEvent) {
window.attachEvent("resize", mmListener);
}
mmListener();
@asimpson
asimpson / gist:3813853
Last active October 11, 2015 05:58
Exclude sublime workspace and project files from sublime sidebar
{
"folders":
[
{
"file_exclude_patterns":
[
"*.sublime-*"
],
"folder_exclude_patterns":
[
@asimpson
asimpson / tomorrow-theme.css
Created October 5, 2012 17:48
Web Inspector Tomorrow Theme
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2011
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@asimpson
asimpson / font-size.scss
Created October 5, 2012 20:24
Old Scss Font-size mixin
@mixin font-size( $decimal-size ) {
font-size: $decimal-size * $base-font-multiplier * 16px;
font-size: $decimal-size * 1rem;
}
@asimpson
asimpson / sitemap-snippet
Created October 31, 2012 16:57
EE Snippet for sitemap.xml, repeat for each block of urls.
{exp:channel:entries channel="channel-name"}
<url>
<loc>relative_url/{url_title}</loc>
<lastmod>{entry_date format="%Y %m %d"}</lastmod>
<changefreq>time-value</changefreq>
</url>
{/exp:channel:entries}
@asimpson
asimpson / chirp.coffee
Created December 7, 2012 20:38
chirp code
Chirp
user: "a_simpson"
max: 5
count: 5
retweets: true
replies: false
templates:
base: '<ol>{{tweets}}</ol>'
tweet:'<li><time><a href="http://twitter.com/{{user.screen_name}}/statuses/{{id_str}}">{{time_ago}}</a></time><article class="tweet">{{html}}<footer class="tweet-actions"><ul><li><a target="_blank" href="https://twitter.com/intent/retweet?tweet_id={{id_str}}" title="retweet">Re-tweet</a></li><li><a target="_blank" href="https://twitter.com/intent/favorite?tweet_id={{id_str}}" title="favorite">Favorite</a></li><li><a target="_blank" href="https://twitter.com/intent/tweet?in_reply_to={{id_str}}" title="reply">Reply</a></li></ul></footer></article></li>'
target: "tweets"
@asimpson
asimpson / links.md
Created October 15, 2015 16:18
Roundup of links from my npm as a build tool talk at GemCityJS
@asimpson
asimpson / setInterval.coffee
Created December 17, 2012 16:45
setInterval, clearInterval
sliderAnimation: ->
window.setInterval ->
APP.SLIDER.runSlider $('.main-content .slider')
, 4000
anotherFunction: ->
window.clearInterval(APP.SLIDER.sliderAnimation)