Skip to content

Instantly share code, notes, and snippets.

Cory House coryhouse

Block or report user

Report or block coryhouse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@coryhouse
coryhouse / gist:8ff24cf2680035e67eea
Last active Aug 29, 2015
Cache Busting via Regex and Gulp.js
View gist:8ff24cf2680035e67eea
'use strict';
var gulp = require('gulp');
var concat = require('gulp-concat');
var replace = require('gulp-replace');
gulp.task('js', function () {
var filename = 'script' + getDate() + '.js';
gulp.src('src/**/*.js')
.pipe(concat(filename))
View gist:7334587ca39f67dc34d4
//user.js
define([], function () {
var cart = require('cart'); //using this style to work around circular reference
var numItemsInCart = cart.items.length;
//logic to initialize user's cart icon continues here...
});
View gist:1f925fa4aec1d8978346
//cart.js
define(['user'], function (user) {
var calculateSalesTax = function() {
var userPostalCode = user.postalCode;
//logic to calculate sales tax continues...
};
});
View gist:f93feadd6a0de6808f7c
//user.js
define(['cart'], function (cart) {
var numItemsInCart = cart.items.length;
//logic to initialize user's cart icon continues here...
});
@coryhouse
coryhouse / gist:c69fe7c13a921e87c4b2
Last active Aug 29, 2015
Manifest.json example
View gist:c69fe7c13a921e87c4b2
{
"script.js": "script-098f6bcd.js"
}
View gist:91e9665d8aeec43a381d
function get(personId) {
//logic to get person here
}
View gist:c20979a477955629d7b6
Person Get(int personId)
{
//logic to get person here
}
View gist:34f727bc3d2466dfdef0
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: 'source-map',
entry: [
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
@coryhouse
coryhouse / eslint.config.json
Created Aug 16, 2015
ESLint config for "Building Applications with React and Flux
View eslint.config.json
{
"ecmaFeatures": {
"jsx": true
},
"env": {
"browser": true,
"node": true,
"jquery": true
},
"rules": {
View googleAnalyticsScript.cs
string googleAnalyticsScript = @"var _gaq = _gaq || [];
_gaq.push(['_setAccount', '" + googleAnalyticsKey + @"']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
You can’t perform that action at this time.