Skip to content

Instantly share code, notes, and snippets.

View tylersticka's full-sized avatar

Tyler Sticka tylersticka

View GitHub Profile
@tylersticka
tylersticka / gist:2696125
Created May 14, 2012 19:48
My DetectSyntax Sublime settings
{
"syntaxes": [
{
"name": "Mustache",
"rules": [
{"file_name": ".*\\.mustache$"}
]
}
]
}
@tylersticka
tylersticka / module.sublime-snippet
Created May 17, 2012 18:43
Sublime Text 2 snippet for JS module
<snippet>
<content><![CDATA[
(function(app) {
var ${1:name} = (function() {
return {
${0}
@tylersticka
tylersticka / gist:2891844
Created June 7, 2012 21:56 — forked from gyndav/gist:1883439
Skip iPhone URL bar
(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) && !location.hash && setTimeout(function(){
!pageYOffset && window.scrollTo(0,1);
}, 1000);
@tylersticka
tylersticka / config.rb
Created July 13, 2012 15:34 — forked from erikjung/config.rb
Testing Compass Vertical Rhythm Loveliness
http_path = "/"
css_dir = ""
sass_dir = ""
images_dir = ""
javascripts_dir = ""
output_style = :expanded
line_comments = false
preferred_syntax = :scss
function partial(names) {
var hbs = require('hbs')
, fs = require('fs');
if (typeof names == 'string') names = [names];
names.forEach(function(name){
hbs.registerPartial(name, fs.readFileSync(__dirname + '/../views/partials/' + name + '.hbs', 'utf-8'));
});
}
@tylersticka
tylersticka / ko.bindingHandlers.transitionEnd.js
Created May 3, 2013 04:06
Rough transitionEnd binding for Knockout
/*
* Sample usage:
* <div data-bind="transitionEnd: modelMethod"></div>
*
* Issues:
* - Webkit-only event name
* - Fires multiple times when multiple properties are transitioned
*/
ko.bindingHandlers.transitionEnd = {
init: function (element, valueAccessor) {
/**
* fitvids.js is awesome but kind of dependent on pretty
* ideal and predictable markup. Unfortunately, a lot of
* services and sites seem to break it.
*
* This is a dirtier but more forgiving spin on the same
* idea. It is probably worse, but it works.
*
* https://gist.github.com/tylersticka/5967626
*/
@tylersticka
tylersticka / scrollable.scss
Created July 19, 2013 22:03
A class I sometimes use in my SASS/SCSS projects to add native-style scrolling to a fixed container in mobile or hybrid-mobile web apps.
// Native scrolling (iOS 5+, Android 4+)
.scrollable {
overflow: auto; // Fallback for non-touch browsers
-webkit-overflow-scrolling: touch; // Native-esque scrolling on touch-enabled webkit
// Everything below here improves performance of scrolling. You can omit this at
// first and add as your content becomes more complex and performance needs a boost.
&, > * {
-webkit-backface-visibility: hidden;
@tylersticka
tylersticka / .profile
Last active August 29, 2015 13:56
Helpful Pattern Lab aliases for your bash profile.
alias plbuild="php core/builder.php -gc" # Pattern Lab: Build/Clean
alias plwatch="php core/builder.php -rw" # Pattern Lab: Watch/Sync
@tylersticka
tylersticka / chrome-webfont-fix.js
Last active August 29, 2015 13:57
Quick and dirty fix for Chrome 32/33 webfont issue.
/**
* Chrome 32/33 webfont issue fix.
* Requires jQuery.
* More info: http://blog.cloudfour.com/chrome-webfont-issues/
*/
(function($, window){
// only proceed if this is Chrome
if (window.navigator.userAgent.indexOf('Chrome') === -1) return;
// only proceed if the version is 32 or greater