Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View RyanCCollins's full-sized avatar

Ryan Collins RyanCCollins

View GitHub Profile
@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
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: "" };

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.

@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)
@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 / array-from-range.md
Created September 2, 2016 02:57
Create an array of 1 through n numbers in one line of JS

Create an array of numbers 1 to N

const N = 20;
Array.apply(null, { length: N }).map(Number.call, Number)

Another option

const arrayOfRange = (n) => Array(n).join().split(',').map((_, i) => i);
@RyanCCollins
RyanCCollins / this-binding.md
Created September 26, 2016 04:42
This binding, how JavaScript does it.
  1. Was the object called with the new keyword, if so use the newly created object.
  2. Was the object called with Call or Apply? If so, use that object.
  3. Was the object called by a containing / owning object? If so, use it.
  4. Default to the global.

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 / oolo.md
Last active September 30, 2016 03:38
OOLO
var Foo = {
  init: function(who) {
    this.me = who;
  },
  identify: function() {
    return "I am " + this.me;
  }
}
@RyanCCollins
RyanCCollins / ex1-prototype-style.js
Created September 30, 2016 03:47 — forked from getify/ex1-prototype-style.js
OLOO (objects linked to other objects) pattern explored (with comparison to the prototype style of the same code)
function Foo(who) {
this.me = who;
}
Foo.prototype.identify = function() {
return "I am " + this.me;
};
function Bar(who) {
Foo.call(this,"Bar:" + who);