Skip to content

Instantly share code, notes, and snippets.

@hedgerh
hedgerh / BSTree.cpp
Last active March 11, 2016 06:11
A Binary Search Tree implementation I wrote in Sophomore year Data Structures
/**
*
* Implementation of the Binary Search Tree Class
*
* @file BSTree.cpp
* @author Harry Hedger
* @date October 7, 2012
*
**/
foo = [{ order: 1 }, { order: 2 }, { order: 3 }, { order: 4 }]
# First Attempt
nextPage = foo.select{ |f| f.order == current.order+1 } || foo.select{ |f| f.order == 1 }
# Second Attempt
nextPage = foo.select{ |f| f.order == current.order+1 || f.order == 1 }
@hedgerh
hedgerh / link-button.css
Created February 17, 2016 03:59
Styles to make a button look like a hyperlink
for f in ../src/locales/*.js; do
echo $f
done
body {
}
header {
}
a {
}
.hello {
.panel-group .panel {
display: inline-block;
width: 18%;
}
"scripts": {
"watch": "npm run watch:js & npm run watch:css",
"watch:js": "watchify js/lib/transloadit-js-client.js -do build/transloadit-js-client.js",
"watch:css": "nodemon -e scss -x \"npm run build:css\"",
"preview": "npm run watch & http-server ./build -d -o "
}
return {
...state,
key1: [...arr, action.payload.element]
}
{
key1: {
arr: []
},
key2: {
arr: []
}
}
import Reflux from 'reflux';
/**
* Define all async actions for blog store.
* Using 'failure' because Reflux acts weird when using 'failed'.
*/
export default Reflux.createActions({
"addPost": { children: ["completed", "failure"] },
"deletePost": { children: ["completed", "failure"] },