Skip to content

Instantly share code, notes, and snippets.

View jaredwilli's full-sized avatar
🏄‍♂️

Jared Williams jaredwilli

🏄‍♂️
View GitHub Profile
@jaredwilli
jaredwilli / Enhance.js
Created November 24, 2017 09:06 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@jaredwilli
jaredwilli / coverage.js
Created November 10, 2017 22:39 — forked from paulirish/coverage.js
JS coverage profiler data via protocol
'use strict';
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const launchChrome = () =>
chromeLauncher.launch({
chromeFlags: ['--disable-gpu', '--headless']
});
componentWillReceiveProps( nextProps, nextContext)
shouldComponentUpdate(nextProps,nextState,nextContext)
componentWillUpdate(nextProps,nextState,nextContext)
componentDidUpdate(prevProps,prevState,prevContext)
@jaredwilli
jaredwilli / bootstrapNewMac
Created November 7, 2017 03:13 — forked from natelandau/bootstrapNewMac
A bootstrap script to install my dotfiles and configure a new computer
#!/usr/bin/env bash
# This bootstraps installing ssh-keys to github
# set colors
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
ORANGE="$(tput setaf 172)"
else
@jaredwilli
jaredwilli / .bash_profile
Created November 7, 2017 00:51 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
/**
* Reverse a string
*
* @param {String} input String to reverse
* @return {String} The reversed string
*/
var reverse = function (input) {
// ...
return output;
};
// Invoking a function and applying it have the same
// result. apply() takes two parameters: the first one is an object to bind to this inside of
// the function, the second is an array or arguments, which then becomes the array-like
// arguments object available inside the function. If the first parameter is null, then this
// points to the global object, which is exactly what happens when you call a function
// that is not a method of a specific object.
// When a function is a method of an object, there’s no null reference passed around. Here the
// object becomes the first argument to apply():

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
# Markdown Cheat Sheet
# H1 tag
## H2 tag
### H3 tag
#### H4 tag
##### H5 tag
###### H6 tag
*This text will be italic*
function _getUtcTime () {
var
d = date,
i = 0,
arr,
t;
d = d || new Date(); // default to now
arr = [