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 / 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 / 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 / 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 / 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:/
const path = require('path')
const NODE_ENV = process.env.NODE_ENV || 'development'
const outputFile = 'pdfmake.js'
const libraryName = 'pdfmake'
const config = {
entry: './src/browser-extensions/pdfMake.js',
output: {
path: path.join(__dirname, './build'),
@danawoodman
danawoodman / index.js
Last active December 22, 2016 18:19
Example of using WebPack to create frontend assets for a non-SPA (Single Page App) project where you selectively load React components within specific templates.
import MyStuff from 'frontend/components/my-stuff'
module.exports = {
renderStuff(node, props) {
// Wrap in <Provider/> here too if using Redux
ReactDOM.render(<MyStuff {...props} />, node)
}
}
@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 };
},
import React, { Component } from "react";
function ProductItem({ product }) {
return (
<li>
{product.name} {product.price}
</li>
);
}
alias -='cd -'
alias ..='cd ..'
alias ..-='cd .. && cd -'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias be='bundle exec'
alias cl='clear'
alias cleanup='find . -name '\''*.DS_Store'\'' -type f -ls -delete'
alias d='docker'