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
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];
@coryhouse
coryhouse / authorApi.js
Created Aug 6, 2015
Mock Author API for "Building Applications with React and Flux" on Pluralsight
View authorApi.js
"use strict";
//This file is mocking a web API by hitting hard coded data.
var authors = require('./authorData').authors;
var _ = require('lodash');
//This would be performed on the server in a real app. Just stubbing in.
var _generateId = function(author) {
return author.firstName.toLowerCase() + '-' + author.lastName.toLowerCase();
};
@coryhouse
coryhouse / gist:9e09fa659cf89e4eddef
Created Aug 6, 2015
Author data for "Building Applciations with React and Flux" on Pluralsight
View gist:9e09fa659cf89e4eddef
module.exports = {
authors:
[
{
id: 'cory-house',
firstName: 'Cory',
lastName: 'House'
},
{
id: 'scott-allen',
@coryhouse
coryhouse / courseApi.js
Created Aug 6, 2015
Mock CourseAPI for "Building Applications with React and Flux" on Pluralsight
View courseApi.js
"use strict";
//This file is mocking a web API by hitting hard coded data.
var courses = require('./courseData').courses;
var _ = require('lodash');
//This would be performed on the server in a real app. Just stubbing in.
var _generateId = function(course) {
return course.title.replace(' ', '-');
};
@coryhouse
coryhouse / courseData.js
Created Aug 6, 2015
Course data for "Building Applications with React and Flux" on Pluralsight
View courseData.js
module.exports = {
courses: [
{
id: "clean-code",
title: "Clean Code: Writing Code for Humans",
watchHref: "http://www.pluralsight.com/courses/writing-clean-code-humans",
author: {
id: "cory-house",
name: "Cory House"
},
@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": {
@coryhouse
coryhouse / package.json
Last active Dec 4, 2019
Example of pre and post scripts in package.json
View package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"prebuild": "echo I run before the build script",
"build": "cross-env NODE_ENV=production webpack",
"postbuild": "echo I run after the build script"
}
}
@coryhouse
coryhouse / package.json
Last active Dec 5, 2019
Example of calling one script from another
View package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"clean": "rimraf ./dist && mkdir dist",
"prebuild": "npm run clean",
"build": "cross-env NODE_ENV=production webpack"
}
}
@coryhouse
coryhouse / package.json
Last active Dec 20, 2015
Example of hacky comment in package.json
View package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"clean-comment": "Clean the dist folder before the build by removing it and recreating it.",
"clean": "rm -rf ./dist && mkdir dist"
}
}
@coryhouse
coryhouse / package.json
Last active Jan 17, 2016
Example of using && to call multiple scripts, serially
View package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"remove-dist": "rimraf ./dist",
"create-dist": "mkdir dist && cd dist && mkdir js && mkdir styles",
"prebuild": "npm run remove-dist && npm run create-dist",
"build": "webpack"
}
You can’t perform that action at this time.