Skip to content

Instantly share code, notes, and snippets.

@cheapsteak
cheapsteak / helper.md
Last active August 29, 2015 14:02
Turning a normal array into an associative array using aribitrary property

Given

var countries = [
  {
    country: "Canada",
    capital: {
      name: "Ottawa",
      population: 883391
    }
 },
@cheapsteak
cheapsteak / 0_reuse_code.js
Created July 8, 2014 21:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// ==UserScript==
// @name Monster Minigame Auto-script
// @namespace https://github.com/wchill/steamSummerMinigame
// @description A script that runs the Steam Monster Minigame for you. Modified from mouseas's original version to include autoclick.
// @version 1.0
// @match http://steamcommunity.com/minigame/towerattack*
// @updateURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js
// @downloadURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js
// ==/UserScript==
@cheapsteak
cheapsteak / index.js
Created July 7, 2015 14:57
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var RouteRecognizer = require('route-recognizer');
var router = new RouteRecognizer();
var handler = function () {
};
import exec from 'promised-exec';
import chalk from 'chalk';
import {argv} from 'yargs';
import rimraf from 'rimraf';
import buildConfig from './build-config.js';
const error = chalk.red;
const ok = chalk.green;
const yellow = chalk.yellow;
@cheapsteak
cheapsteak / workflow.md
Last active August 29, 2015 14:25
Workflow with Dploy.io (now DeployBot)

DeployBot:

  • Allows anyone to deploy without giving them server credentials
  • Ease of rollbacks
    image

Method 1: Check in compiled code

  1. Make sure working directory is clean (all changes committed or stashed)
  2. Checkout deploy/(dev|qa|staging|production)
  3. Pull origin
  4. Merge from previous branch

Swagger RESTful API Documentation Specification

Version 2.0

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

The Swagger specification is licensed under The Apache License, Version 2.0.

Introduction

@cheapsteak
cheapsteak / SassMeister-input.scss
Created October 18, 2015 18:34
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
div {
width: calc(100% - 100px);
}