Skip to content

Instantly share code, notes, and snippets.

View danawoodman's full-sized avatar
👨‍🔬
Hacking away...

Dana Woodman danawoodman

👨‍🔬
Hacking away...
View GitHub Profile
@danawoodman
danawoodman / git-workflow.md
Last active September 30, 2018 19:41
Git Workflow

Git Workflow

Below outlines the general git workflow I find works well in most situations/teams/projects.

Feature Branches

Make sure master is up to date before starting a feature branch.

@danawoodman
danawoodman / useful-git-commands.md
Last active August 29, 2015 13:59
Useful Git Commands

Branching

Checkout New Branches

To create a new branch from the current branch and check it out in one command:

git checkout -b my-branch

Delete Branches

@danawoodman
danawoodman / make output
Created October 1, 2014 23:34
OpenSCAD install output
/Users/dana/code/libraries/install/bin/uic src/MainWindow.ui -o objects/ui_MainWindow.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -c -pipe -O2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -Wall -W -DOPENSCAD_VERSION=2014.10.01 -DOPENSCAD_YEAR=2014.0 -DOPENSCAD_MONTH=10.0 -DOPENSCAD_DAY=01.0 -DDEBUG -DENABLE_MDI -DENABLE_CGAL -DENABLE_OPENCSG -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DUSE_SCINTILLA_EDITOR -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_OPENGL_LIB -DQT_MACEXTRAS_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../libraries/install/mkspecs/macx-clang -I. -Isrc -I../libraries/install/include -I../libraries/install/lib/QtPrintSupport.framework/Versions/5/Headers -I../libraries/install/lib/QtOpenGL.framework/Versions/5/Headers -I../libraries/install/lib/QtMacExtras.framework/Versions/5/Headers -I../libraries/install/lib/QtWidgets.framework/Versions/5/
@danawoodman
danawoodman / 0-react-hello-world.md
Last active March 9, 2024 00:32
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@danawoodman
danawoodman / set-interval-mixin.js
Last active November 20, 2017 08:09
set-interval-mixin.js
/*
SetIntervalMixin for React.
Usage:
var MyComponent = React.createClass({
getInitialState: function () {
return { value: 0 };
},
@danawoodman
danawoodman / group-by-hours.js
Last active August 29, 2015 14:16
Group and sum range of hours by the hour
var _ = require('lodash');
var ranges = [
["12:00", 0.0], ["12:15", 0.0], ["12:30", 0.0], ["12:45", 0.0],
["01:00", 0.0], ["01:15", 0.0], ["01:30", 0.0], ["01:45", 0.0],
["02:00", 0.0], ["02:15", 0.0], ["02:30", 0.0], ["02:45", 0.0],
["03:00", 0.0], ["03:15", 0.0], ["03:30", 0.0], ["03:45", 0.0],
["04:00", 0.0], ["04:15", 0.0], ["04:30", 0.0], ["04:45", 0.0],
["05:00", 0.0], ["05:15", 0.0], ["05:30", 0.0], ["05:45", 0.0],
["06:00", 0.0], ["06:15", 0.0], ["06:30", 0.0], ["06:45", 0.0],
@danawoodman
danawoodman / 1-react-websockets-reflux.md
Last active September 15, 2021 14:48
Using WebSockets with Reflux and React

WebSockets + Reflux + React

Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.

Overview

This trifect works well if you think of things like so:

  1. Reflux Store: The store fetches, updates and persists data. A store can be a list of items or a single item. Most of the times you reach for this.state in react should instead live within stores. Stores can listen to other stores as well as to events being fired.
  2. Reflux Actions: Actions are triggered by components when the component wants to change the state of the store. A store listens to actions and can listen to more than one set of actions.
@danawoodman
danawoodman / 0-javascript-cheat-sheet.md
Created April 8, 2015 04:17
JavaScript Cheat Sheet

JavaScript Cheat Sheet

This is intended as a grab bag of tips, shortcuts, reference and otherwise useful information related to JavaScript (and Node.js).

Language Features

bind

Bind is a very useful tool for changing the scope of this within functions as well as passing in parameters:

@danawoodman
danawoodman / pdf.js
Created April 10, 2015 19:41
Example of using pdfkit in Node.js
var fs = require('fs');
var PDFDocument = require('pdfkit');
var pdf = new PDFDocument({
size: 'LEGAL', // See other page sizes here: https://github.com/devongovett/pdfkit/blob/d95b826475dd325fb29ef007a9c1bf7a527e9808/lib/page.coffee#L69
info: {
Title: 'Tile of File Here',
Author: 'Some Author',
}
});
@danawoodman
danawoodman / flux-options.md
Last active April 22, 2016 13:39
Flux and Flux-like Options

Flux and Flux-like Options

A non-exhaustive list of flux and flux-like libraries with relevant information and notes.

Library Stars Latest Release
Facebook flux
reflux
fluxxor
marty [](https:/