Skip to content

Instantly share code, notes, and snippets.

View coryhouse's full-sized avatar

Cory House coryhouse

View GitHub Profile
@coryhouse
coryhouse / package.json
Last active December 20, 2015 02:30
Example of hacky comment in 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 / gist:0e085a3a8382f8e1f993
Created December 20, 2015 05:12
Example of using pipes and redirects in Unix
cat bigFile.txt | grep 'Cory House' > linesThatHaveMyName.txt
public class WebsiteSetup
{
public string GoogleAnalyticsKey;
}
@coryhouse
coryhouse / package.json
Last active January 17, 2016 03:29
Example of using && to call multiple scripts, serially
{
"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"
}
@coryhouse
coryhouse / package.json
Created December 20, 2015 05:07
Calling a separate build script from package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"build": "node build.js"
}
}
import React from 'react';
class HelloWorld extends React.Component {
constructor(props) {
super(props);
}
sayHi(event) {
alert(`Hi ${this.props.name}`);
}
import React from ‘react’;
const HelloWorld = ({name}) => (
 <div>{`Hi ${name}`}</div>
);
export default HelloWorld;
public class FuelSavingsCalculator
{
public readonly int milesDriven;
public readonly FuelSavingsCalculatorTimeFrame timeframe;
public readonly int tradeMpg;
public readonly int newMpg;
public readonly decimal ppg;
public FuelSavingsCalculator(int milesDriven, FuelSavingsCalculatorTimeFrame timeframe, int tradeMpg, int newMpg, decimal ppg)
{
{
"firstName": "Cory",
"lastName": "House
}
@coryhouse
coryhouse / mockData.json
Last active October 7, 2016 10:12
Mock data for API call in "Building a JavaScript Development Environment" on Pluralsight
[
{"id": 1,"newMpg":24,"tradeMpg":18,"pricePerGallon":"$1.34","milesDrivenPerMonth":954},
{"id": 2,"newMpg":28,"tradeMpg":39,"pricePerGallon":"$2.96","milesDrivenPerMonth":298},
{"id": 3,"newMpg":44,"tradeMpg":31,"pricePerGallon":"$3.72","milesDrivenPerMonth":264}
]