Instantly share code, notes, and snippets.

View startproject.sh
#!/usr/bin/env bash
mkdir -p ./app
echo '{
"name": "my-project",
"version": "0.0.0",
"scripts": {
"dev": "webpack-recipes devserver 9000",
"build": "webpack-recipes build --mode=production"
},
"devDependencies": {
View dynamicStates.js
(function() {
'use strict';
var dynamicStates = function ($stateProvider, $urlRouterProvider) {
var addRoute = function (name, definition) {
$stateProvider.state(name, definition);
};
$urlRouterProvider.deferIntercept();
View dynamic-states.json
{
"state-one": {
"controller": "stateOneController",
"template": "<h1>State One</h1>"
},
"state-two": {
"controller": "stateTwoController",
"template": "<h1>State Two</h1>"
}
}
View custom_events.js
(function () {
var _eventsStack = {};
window.Events = {
emit: function (eventName, message) {
if (!_eventsStack.hasOwnProperty(eventName)) {
_eventsStack[eventName] = [];
}
_eventsStack[eventName].forEach(function (fn) {
fn(message != undefined ? message : {});
});
View README.md

Improve your curl with pretty formmated json responses

requirements node.js

add in your .zshrc

[[ -s $HOME/bin/prettycurl.sh ]] && . $HOME/bin/prettycurl.sh
View gist:b6818e65e55b378b3808
const React = require('react');
const ReactAtellier = require('react-atellier')(React);
class AtellierWrapper extends React.Component {
static propTypes = { message: React.PropTypes.string };
static defaultProps = { message: 'Hello World!' };
render() {
const Icon = React.createClass({
render: function() {
return (
View ATOM_PACKAGES.md

Atom Packages

apm instal \
aligner \
atom-beautify \
autoclose-html \
autocomplete-paths \
color-picker \
editorconfig \
file-icons \
View start_redis_and_couchdb.sh
#!/bin/bash
docker-machine start default 1> /dev/null
eval "$(docker-machine env default)"
RUNNING=$(docker inspect --format="{{ .State.Running }}" redis 2> /dev/null)
if [ $? = 1 ]; then
echo "Container redis doesn\'t exists"
docker run -d -p 6379:6379 -v `pwd`/data/redis:/data --name redis redis
fi
View static.js
var appName = require('./package.json').name
|| require('../../package.json').name;
var ports = require('ports');
var port = ports.getPort(appName + '-hoodie-plugin-social');
module.exports = {
// 'server.pack.post': function (pack) {
// console.log('hook: server.pack.pre called');
// },
View osx-for-hackers.sh
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'