Skip to content

Instantly share code, notes, and snippets.

View RyanCCollins's full-sized avatar

Ryan Collins RyanCCollins

View GitHub Profile
@RyanCCollins
RyanCCollins / thunks-rock.js
Last active August 31, 2016 01:32
Forget Callback inversion of control, thunks are the way to go!
// Playing with Thunks
// See: http://jsbin.com/qebuluveje/edit?js,console
// Awesome!
const fakeAjax = (text, cb) =>
setTimeout(() => {
cb(text);
}, 5000);
function getFile(file) {
var text, fn;
@RyanCCollins
RyanCCollins / curry
Last active July 1, 2016 04:33
FP in JS
const say = (what) =>
(times) =>
[...Array(times||0)].map((v,i)=>i).forEach((_) => console.log(what))
say("What")(30)

Privacy Policy

Last revised on [DATE]

The Gist

[COMPANY] will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@font-face {
font-family: "Proxima Nova";
src: url(data:font/opentype;base64,d09GRgABAAAAAEywABIAAAAAg3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEWU5BAAAGbAAAALgAAAGJNI0oHkZGVE0AAAGUAAAAHAAAABxdnq2WR0RFRgAAByQAAAA4AAAAQgSqBTxHUE9TAAAHXAAABCIAABH0zI0AF09TLzIAAAXUAAAAVwAAAGCAz3p9Y21hcAAASvgAAAG2AAAC5lCJVL9jdnQgAAABsAAAAB4AAAAeCkcLCmZwZ20AAAHQAAABsgAAAmUjtC+nZ2FzcAAAA4QAAAAIAAAACAAAABBnbHlmAAALgAAAO4sAAF8I3FzIU2hlYWQAAAOMAAAANQAAADb9TDtqaGhlYQAABiwAAAAgAAAAJA9PBsBobXR4AABHDAAAAh8AAANsqw8hfGxvY2EAAEksAAABuAAAAbhtqYQ8bWF4cAAABkwAAAAgAAAAIAIDAhpuYW1lAAADxAAAAawAAANRLIw+gnBvc3QAAErkAAAAEwAAACD/DQAocHJlcAAABXAAAABjAAAAdNUcAaMAAAABAAAAAMmJbzEAAAAAyRrF1wAAAADK+niN/pAAAAPGBTYBYADCANABNgE+AWgBmQDkAZIBkAFYAAB42l1Ru05bQRDdDQ+TBBJjg+RoU8xmQhrvhYYCJBBXF8XIdmM5QtqNXORiXMAHUCBRg/ZrBmgoKdKmQcgFUj6BT0BiZk2iKM3Ozuycc+bMknKk6l1a73nqnARSuNOg2abfDql2FuCedH21kZF28EDzzYxeuW7ff8VgM5pyRw2gvOct5SGjaSdQi/bU/za/guE+/2Qeg0FLM01PrZOQHkJgvhm3MPie0ay7/KQvWB0uBgNDimkq7vJzKuV/S3Outgibaxm9dnAmIj+ZBmhqpY1A0186pHo+jmIJctkw1gYTU9afZCL4ZjJd1VQtM751cJfszDt
curl -O -L https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_darwin_amd64.zip
unzip packer_0.8.6_darwin_amd64.zip
sudo mv packer_0.8.6 /usr/local/packer
sudo chown $USER /usr/local/packer/
# then update your .bash_profile with the new path e.g.:
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH"
@RyanCCollins
RyanCCollins / Install-hacksmith-website.md
Created January 24, 2016 03:20
How to install the hacksmith website

First, install nodeJS:


Then, make a new folder called uhubprojects, or whatever, and clone the project to your local computer by running

git clone https://github.com/u-hub/hacksmiths hacksmiths
@RyanCCollins
RyanCCollins / Node_config.md
Last active November 22, 2016 20:47
Standard NodeJS config with NVM

Node configuration.

Update NPM version with the following command

npm update -g npm

Download NVM (Node Version Manager), which will help you to use the correct version of NodeJS

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
@RyanCCollins
RyanCCollins / npm-install-without-sudo.md
Created January 18, 2016 17:28
NPM Install without SUDO

NPM install without SUDO

It's easy! Just change permissions on the .npm directory as shown below.

Try this:

sudo chown -R $(whoami) ~/.npm

Or this:

@RyanCCollins
RyanCCollins / docker-cheatsheet.md
Created January 17, 2016 23:55
Docker Cheatsheet

Remove all containers:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Inspect a container and Network bridging:

docker inspect
docker network inspect