Skip to content

Instantly share code, notes, and snippets.

View GregoryCollett's full-sized avatar

Gregory Collett GregoryCollett

View GitHub Profile
@GregoryCollett
GregoryCollett / Windows 8 System PATH
Created December 3, 2014 14:12
Default Windows 8 System PATH
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
@GregoryCollett
GregoryCollett / pre-commit
Created June 18, 2015 11:06
pre-commit Shell Example (PHP Lint)
#!/bin/bash
# find the changed files, get the name only and pipe result to a while loop
git diff --cached --name-only | while read FILE; do
# ff file matches extension pattern then
if [[ "$FILE" =~ ^.+(php|inc|module|install|test)$ ]]; then
# if file is actually and file that exists then
if [[ -f $FILE ]]; then
# php lint the file and
php -l "$FILE" 1> /dev/null
@GregoryCollett
GregoryCollett / osx-for-hackers.sh
Created November 29, 2015 17:54 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
const compose = (...funcs) => (value) => funcs.reduce((v, fn) => fn(v), value);
const typeValueAction = (type) => (value) => ({ type, value });
import React, { Component } from 'react';
export const withLifecycle = (hooks) => (BaseComponent) => {
return class WithLifecycle extends Component {
componentWillMount() {
hooks.willMount && hooks.willMount(this.props);
}
import React, { Component } from 'react';
export const withReducer = (
stateName = 'internalState',
dispatchName = 'internalDispatch',
reducer = (state) => state,

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
// from and to are objects that live somewhere else (for examples sake)
uiGmapGoogleMapApi.then(function(maps){
var directionsService = new maps.DirectionsService();
var request = {
origin: new maps.LatLng(
from.lat(),
from.lng()
),
'use strict';
class Frame {
constructor(samples){
// A single frame == 1 second of audio with a 44100 sample rate
this.prev = null;
this._next = null;
// this.samples = samples || new Float32Array(44100);
this.samples = samples || [];
this.callbacks = [];