Skip to content

Instantly share code, notes, and snippets.

@auggod
auggod / gulpfile.js
Last active August 29, 2015 14:14
gulpfile
var gulp = require('gulp')
, jade = require('gulp-jade')
, stylus = require('gulp-stylus')
, livereload = require('gulp-livereload')
, autoprefixer = require('autoprefixer-stylus');
gulp.task('templates', function() {
return gulp.src('./index.jade')
.pipe(jade({
pretty: true
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@auggod
auggod / origin.js
Last active November 16, 2015 15:20
app.all '*', (req, res, next) ->
return next! if not req.get 'Origin'
allowedOrigins = [
'http://localhost:3000'
]
origin = req.get 'Origin'
if _.contains(allowedOrigins, origin)
res.header 'Access-Control-Allow-Origin', origin
res.header 'Access-Control-Allow-Methods', 'GET,POST,PUT,DELETE,OPTIONS'
res.header 'Access-Control-Allow-Headers', 'Content-Type, Accept, Cache-Control, Pragma, Origin, Authorization, X-Tracklist-User-Id, X-Tracklist-Session-Id, X-Requested-With'
@auggod
auggod / nginx.conf
Last active April 30, 2016 11:22
Get around Soundcloud Safari, iOS bug. See issue: https://github.com/soundcloud/soundcloud-javascript/issues/27
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/tracklist.crt;
ssl_certificate_key /etc/ssl/private/tracklist.key;
server_name proxy.yourapp.com;
location / {
allow all;
proxy_set_header X_FORWARDED_PROTO https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
server {
listen 443 ssl;
ssl on;
ssl_certificate /etc/ssl/certs/key.crt;
ssl_certificate_key /etc/ssl/private/key.key;
server_name hostname.tld;
location / {
allow 127.0.0.1;
#allow all;
deny all;
@auggod
auggod / API.md
Created January 10, 2017 13:23 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@auggod
auggod / restful.js
Created March 5, 2017 14:38 — forked from BinaryMuse/restful.js
Express API with Async/Await
import express from "express";
/**
* Takes a route handling function and returns a function
* that wraps it after first checking that the strings in
* `reserved` are not part of `req.body`. Used for ensuring
* create and update requests do not overwrite server-generated
* values.
*/
function checkReservedParams(routeHandler, ...reserved) {

Keybase proof

I hereby claim:

  • I am auggod on github.
  • I am auggod (https://keybase.io/auggod) on keybase.
  • I have a public key whose fingerprint is 619F DF33 7212 2515 5556 D392 1D68 11A7 0E64 9372

To claim this, I am signing this object:

@auggod
auggod / index.js
Last active December 6, 2017 03:00
requirebin sketch
const html = require('bel')
const morph = require('nanomorph')
class PlayCount {
constructor(options) {
const { count, fps } = options
this.options = options
this.timings = {
count,
@auggod
auggod / index.js
Last active December 19, 2017 13:40
requirebin sketch
const html = require('bel')
const button = html`
<button class="f1 w-100" ondblclick=${handleDoubleClick} ontouchstart=${handleTouchStart} ontouchend=${handleTouchEnd}>Double click me</button>
`
const timings = {
touchDuration: 500
}