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
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"
}
}
@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
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 = (props) => {
const sayHi = (event) => {
alert(`Hi ${props.name}`);
};
return (
<div>
<a href="#" onClick={sayHi}>Say Hi</a>
import React from ‘react’;
const HelloWorld = ({name}) => (
 <div>{`Hi ${name}`}</div>
);
export default HelloWorld;
@coryhouse
coryhouse / package.json
Last active July 6, 2018 14:52
Package.json file for "Building Applications in React and Redux in ES6" on Pluralsight
{
"name": "ps-redux",
"version": "1.0.0",
"description": "Starter kit for React and Redux Pluralsight course by Cory House",
"scripts": {},
"author": "Cory House",
"license": "MIT",
"dependencies": {
"babel-polyfill": "6.8.0",
"bootstrap": "3.3.6",
@coryhouse
coryhouse / ReactBindingApproaches.js
Last active May 4, 2019 18:12
React Binding Approaches
// Approach 1: Use React.createClass
var HelloWorld = React.createClass({
getInitialState() {
return { message: 'Hi' };
},
logMessage() {
// this magically works because React.createClass autobinds.
console.log(this.state.message);
},
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)
{
@coryhouse
coryhouse / package.json
Last active April 15, 2023 15:08
package.json for Building a JS Development Environment on Pluralsight
{
"name": "javascript-development-environment",
"version": "1.0.0",
"description": "JavaScript development environment Pluralsight course by Cory House",
"scripts": {
},
"author": "Cory House",
"license": "MIT",
"dependencies": {
"whatwg-fetch": "1.0.0"
@coryhouse
coryhouse / .eslintrc.json
Last active April 15, 2023 15:08
.eslintrc.json file for "Building a JavaScript Development" Pluralsight course
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"