Skip to content

Instantly share code, notes, and snippets.

View carpeliam's full-sized avatar
👋
say hi!

Liam Morley carpeliam

👋
say hi!
View GitHub Profile

Usage

  1. npm install babel-loader imports-loader webpack --save
  2. Create webpack.config.js
  3. Move index.ios.js to src/index.ios.jsx
  4. webpack --watch

Example

src/index.ios.jsx

@jamesgpearce
jamesgpearce / dimoc.md
Last active September 22, 2017 23:34
DIMOC: Do It Myself or Callback - a simple pattern for React components

TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.

Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:

/* @flow */
var React = require('react');

var Letter: React.ReactClass = React.createClass({
  getInitialState: function(): any {
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 7, 2024 01:25
Essential JavaScript Links
@ob-ivan
ob-ivan / cookiebot.js
Last active June 27, 2022 07:47 — forked from jeresig/cookiebot.js
A little bit intelligent Cookie Clicker bot.
CookieBot = {
// Inner-use enum constants //
INTERVAL_BAKE : 0,
INTERVAL_GOLDEN : 1,
INTERVAL_PRODUCT : 2,
INTERVAL_UPGRADE : 3,
INTERVAL_DRAGON : 4,
INTERVAL_SANTA : 5,
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
@joshuakfarrar
joshuakfarrar / drone-client.js
Last active December 19, 2015 03:49
an ar drone client from nodeconf2013
var arDrone = require('ar-drone')
, client = arDrone.createClient()
, stdin = process.openStdin()
, isAirborne
, speedFactor = 5
, speeds = {
x: 0,
y: 0,
z: 0
}
@olizilla
olizilla / meet-meteor.md
Last active December 17, 2015 22:48
Developer with ideas, meet Meteor; Meteor meet ideas. Oh look, they've become manifest.

Meet Meteor

The framework for turning ideas into webapps

A full stack web framework

  • Manages client and server side.
  • Things like Rails manage server side issues.
  • Things like Ember & Angular provide front-end structure.
  • Meteor helps out with both.
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: