Skip to content

Instantly share code, notes, and snippets.

View chrisfrancis27's full-sized avatar
Verified beard

Chris Francis chrisfrancis27

Verified beard
View GitHub Profile
@chrisfrancis27
chrisfrancis27 / Origami-Key-Bindings.json
Created November 18, 2014 15:49
Sublime Text - Package - Key Bindings - Origami
[
{
"keys": ["super+k", "super+w"],
"command": "destroy_pane",
"args": {"direction": "self"}
}
]
@chrisfrancis27
chrisfrancis27 / apple2.zsh-theme
Created November 17, 2014 10:38
ZShell - Apple2 Theme
function toon {
echo -n ""
}
get_git_dirty() {
git diff --quiet || echo '*'
}
autoload -Uz vcs_info
autoload -U colors && colors
@chrisfrancis27
chrisfrancis27 / main.js
Created February 7, 2014 12:17
Feature toggle snippet
// If 'sidebarNav' feature is toggled ON...
if (Features.sidebarNav) {
// Load the new SidebarNav module
require(['modules/sidebar'], function(SidebarNav) {
// ...
});
}
@chrisfrancis27
chrisfrancis27 / Gruntfile.js
Created November 9, 2013 17:10
A pretty decent little grunt file with production and dev configurations. Useful for pre-compiling Jade and Stylus, minifying / combining CSS and JS.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Clean the build output directory before we begin
clean : {
options: {
force : true
},
@chrisfrancis27
chrisfrancis27 / globals-are-bad.js
Created October 29, 2013 15:16
Find all the shitty globals on your window object.
for (var k in Object.keys(window)) {
console.log(Object.keys(window)[k], window[Object.keys(window)[k]])
}
@chrisfrancis27
chrisfrancis27 / positionFixedMediaQuery.css
Last active December 25, 2015 12:39
CSS "position:fixed" media query HACK (for use with Modernizr)
/* Basically a gnarly hack to try and roughly detect Android <= 2.3 without UA sniffing */
@media screen and (-webkit-min-device-pixel-ratio: 1.0) { /* Can't use ratio 1.5 as original Galaxy S was too low res */
.no-csstransforms3d .someFixedPositionClass { /* Android > 2.3 supports 3D transforms */
position: absolute; /* Fixed not supported, use absolute instead, or whatever */
}
}
@chrisfrancis27
chrisfrancis27 / SublimeLinter.sublime-settings
Created August 17, 2013 10:26
Sublime Text 2 SublimeLinter plugin settings
{
"sublimelinter_gutter_marks_theme": "hard",
"jshint_options":
{
// Enforcement options
"curly" : true,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"latedef" : true,
@chrisfrancis27
chrisfrancis27 / main.js
Created August 15, 2013 11:14
JS module conditional feature toggle
// If 'sidebarNav' feature is toggled ON...
if ($('html').hasClass('.feat-sidebarNav')) {
// Load the new SidebarNav module
require(['modules/sidebar'], function(SidebarNav) {
// ...
});
}
<snippet>
<content><![CDATA[
/*jslint browser: true, white: true */
/*global define */
define([
'${1:dependencies}'
], function (${2:dependencyArgs}) {
'use strict';
@chrisfrancis27
chrisfrancis27 / Preferences.sublime-settings
Last active December 20, 2015 23:08
Sublime Text 3 user settings (Ubuntu)
{
"font_face": "UbuntuMono",
"font_size" : 12,
"tab_size" : 2,
"translate_tabs_to_spaces": true,
"detect_indentation": false,
"draw_minimap_border": true,
"always_show_minimap_viewport": true,
"caret_style": "smooth",
"line_padding_top": 2,