Skip to content

Instantly share code, notes, and snippets.

@danharper
danharper / 1-sleep-es7.js
Created February 8, 2015 16:55
ES7's async/await syntax.
// ES7, async/await
function sleep(ms = 0) {
return new Promise(r => setTimeout(r, ms));
}
(async () => {
console.log('a');
await sleep(1000);
console.log('b');
})()
mdesales@ubuntu [11/30/201423:36:56] ~/dev/github-intuit/docker-images/platform/mule-3.4/source (master *) $ go run trying.go
Will start downloading file1... It might take 3787
Will start downloading file2... It might take 8639
Will start downloading file3... It might take 5633
FINISHED: file1 downloaded in 3787
FINISHED: file3 downloaded in 5633
FINISHED: file2 downloaded in 8639
[file1 downloaded in 3787 file3 downloaded in 5633 file2 downloaded in 8639]
8.641097774s
@nijikokun
nijikokun / about.md
Last active June 25, 2020 13:57
Revival minimal github pages theme (original by @orderedlist)

Revival Minimal Theme for Github Pages

I was tired of the unreadable minimal theme by @orderedlist so I overhauled the font sizing and typography to generate this beautiful modern style for forward thinking open source projects to use.

If you've ever used Gitbook, you'll be familiar with my modern / crisp styling and attention to detail.

Preview

Install

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

@joshfraser
joshfraser / gist:819308dbae43ff70d892
Created June 6, 2014 21:43
clickjacking POC for amazon.com
<html>
<title>Click-jacking on Amazon.com</title>
<head>
<style type="text/css">
body {
background-color: #fafafa;
}
a {
color:rgb(228, 121, 17);
@andrewdc
andrewdc / gulpfile.js
Created April 14, 2014 15:39
Simple Static Site Generator with Gulp
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
rubysass = require('gulp-ruby-sass'),
fileinclude = require('gulp-file-include'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
livereload = require('gulp-livereload'),
lr = require('tiny-lr'),
connect = require('gulp-connect'),
@DavidVaini
DavidVaini / round.go
Created April 9, 2014 19:58
Arggh Golang does not include a round function in the standard math package. So I wrote a quick one.
package main
import (
"log"
"math"
)
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
@yvasiyarov
yvasiyarov / gist:9911956
Created April 1, 2014 11:09
rows.Scan() optimal usage
//Prepare buffers for reading: one time before read first chunk
treader.rawBuffer = make([]sql.RawBytes, len(treader.columns))
// rows.Scan wants '[]interface{}' as an argument, so we must copy the
// references into such a slice
// See http://code.google.com/p/go-wiki/wiki/InterfaceSlice for details
treader.scanCallArgs = make([]interface{}, len(treader.rawBuffer))
for i := range treader.rawBuffer {
treader.scanCallArgs[i] = &treader.rawBuffer[i]
}
@lonetwin
lonetwin / Git dot files management
Last active May 20, 2024 23:21
A simple way to manage dotfiles with git without silly symlinks and special tools. Just use negative matches in your .gitignore !
I like to manage dotfiles without having to mess with silly symlinks or having
to install/configure specific dotfile managament tools. So here's what I did:
$ cd ~
$ git init .
$ echo '*' > .gitignore # ignore all files by default
$ echo '!.bashrc' >> .gitignore # ...and then tell git what files not to *not* ignore
$ # ...add other files you may want to track to *not* ignore
$ git add .bashrc # now actually add the files to git
$ git add .gitignore # add the .gitignore to git

"If you want to build a ship, don't drum up people to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea."

  • Antoine de Saint Exupéry