Skip to content

Instantly share code, notes, and snippets.

@whilei
whilei / keybase.md
Created January 17, 2015 11:33
keybase proof

Keybase proof

I hereby claim:

  • I am irstacks on github.
  • I am isaacardis (https://keybase.io/isaacardis) on keybase.
  • I have a public key whose fingerprint is C6D5 ED06 A932 3F4E 0889 B265 7130 F47A 206E 470C

To claim this, I am signing this object:

@whilei
whilei / Log-.md
Created November 27, 2015 14:37 — forked from bgrins/Log-.md
Prevent errors on console methods when no console present and expose a global 'log' function.

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
@whilei
whilei / .slate
Created January 18, 2016 12:34
slate file
# This is not the default .slate file.
# This is my .slate file.
# There are many like it,
# but this one is mine.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config orderScreensLeftToRight false
[user]
name = Mr. Mister
email =
[core]
excludesfile = /Users/mh/.gitignore_global
[alias]
recent-branches = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname)' refs/heads refs/remotes
changes = diff --name-status -r
diffstat = diff --stat -r
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
@whilei
whilei / docx2md.md
Created February 11, 2016 15:11 — forked from jesperronn/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@whilei
whilei / gist:45a2349adc99ee1f80177178ea537089
Created April 9, 2016 01:27 — forked from simonw/gist:92481
Compile nginx standalone without root access
# Compile nginx standalone without root access
mkdir ~/installed
mkdir ~/installed/nginx
mkdir ~/src
cd ~/src
# PCRE dependency - we'll compile against this statically
wget http://kent.dl.sourceforge.net/sourceforge/pcre/pcre-7.8.tar.gz
tar -xzvf pcre-7.8.tar.gz
@whilei
whilei / index.js
Created April 9, 2016 01:28 — forked from spboyer/index.js
ExpressJS AngularJS Static Server
var express = require('express'),
path = require('path'),
fs = require('fs');
var app = express();
var staticRoot = __dirname + '/';
app.set('port', (process.env.PORT || 3000));
app.use(express.static(staticRoot));
@whilei
whilei / config.json
Created April 9, 2016 14:11 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@whilei
whilei / npm-f3-install.sh
Last active June 2, 2020 16:35 — forked from SuperPaintman/npm-f3-install.sh
NPM install for low RAM machins. And "npm install ... killed" problem
#!/bin/bash
#
# Author: SuperPaintman <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
@whilei
whilei / rebase-every-single-branch.sh
Last active August 5, 2016 23:25
rebase everybody
# http://stackoverflow.com/questions/866218/git-how-to-rebase-many-branches-with-the-same-base-commit-at-once
for branch in topic1 topic2 topic3;do git rebase master $branch;done