Skip to content

Instantly share code, notes, and snippets.

View marcusshepp's full-sized avatar
🎯
Focusing

Marcus Shepherd marcusshepp

🎯
Focusing
View GitHub Profile
@marcusshepp
marcusshepp / find_dir.sh
Created August 22, 2016 18:41
find a directory
find . -name foo -type d
@marcusshepp
marcusshepp / rm_last_line.sh
Created August 22, 2016 17:44
sed: remove last line from file
sed -i '' -e '$ d' .gitignore
@marcusshepp
marcusshepp / new_gist_file_0
Created August 12, 2016 18:59
prompt generator
http://ezprompt.net/
@marcusshepp
marcusshepp / package.json
Last active September 27, 2016 13:13
example package.json
{
"name": "todo",
"version": "1.0.0",
"description": "foobar",
"main": "index.js",
"scripts": {
// npm run server requires webpack-dev-server.
// not suer about content base could be something else
"server": "./node_modules/.bin/webpack-dev-server --inline --hot --content-base src",
"test": "echo \"Error: no test specified\" && exit 1"
@marcusshepp
marcusshepp / rest_param.js
Last active August 12, 2016 15:25
Rest parameters
// very similar to *args in Python
// when defining a function
let sum = function(...args) {
return args.reduce((prev, curr) => prev + curr);
};
console.log( sum(1, 2, 3) );
@marcusshepp
marcusshepp / webpack.config.js
Last active September 27, 2016 14:42
webpack config
// simple in-out
module.exports = {
entry: `${__dirname}/src/app.js`,
output: {
path: `${__dirname}/dist`,
filename: 'bundle.js'
},
}
// loaders/transpilers/webpack-dev-server
@marcusshepp
marcusshepp / webpack.md
Last active September 12, 2016 15:01
webpack notes

Webpack

install

npm install webpack -g

npm install --save-dev webpack

set up babel transpiler and ecma 2015

npm install babel-preset-react

@marcusshepp
marcusshepp / curly.sh
Created August 11, 2016 15:40
file manipulation -- creating/rm muiltple files with curly braces
touch foo/bar/{marcus,nathan}.rb
ls foo/bar/
# .
# ..
# marcus.rb
# nathan.rb
rm foo/bar/{marcus,nathan}.rb
ls foo/bar
# .
# ..
@marcusshepp
marcusshepp / kanban.md
Last active August 5, 2016 20:47
notes for kanban demo on survive js
@marcusshepp
marcusshepp / add_attr.js
Created August 4, 2016 12:51
vanilla js add attribute
document.createElement("div").setAttribute("style", "color:blue;")