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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / Preferences.sublime-settings
Last active August 29, 2015 14:09
Sublime Text 3 user settings (OSX)
{
"always_show_minimap_viewport": true,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_style": "smooth",
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"copy_with_empty_selection": true,
"detect_indentation": false,
"draw_minimap_border": true,
"enable_tab_scrolling": false,
@chrisfrancis27
chrisfrancis27 / config
Last active August 29, 2015 14:16
Git config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[push]
default = tracking
[remote "origin"]
@chrisfrancis27
chrisfrancis27 / example.js
Created January 25, 2016 11:51
Bookshelf hash IDs
'use strict';
const _ = require('lodash');
const bookshelf = require('../config/bookshelf');
const hasher = require('../utils/hasher');
require('./thing');
let Example = Bookshelf.model.extend({
tableName: 'examples',