Skip to content

Instantly share code, notes, and snippets.

goxc() {
echo "+-BUILD START-----------------------------------------------------------------+"
echo "Building Linux binary..."
GOOS=linux GOARCH=386 CGO_ENABLED=0 go build -o $1.linux $1.go
echo "Building OS X binary..."
go build $1.go
echo "Building Windows binary..."
GOOS=windows GOARCH=386 go build -o $1.exe $1.go
echo "+-BUILD COMPLETE--------------------------------------------------------------+"
}
@jahfer
jahfer / sse.js
Last active December 23, 2015 11:49
Simple SSE Server in Node (taken from somewhere online!)
var PORT = 8081;
var http = require("http");
var fs = require("fs");
var url = require("url");
http.createServer(function (request, response) {
var parsedURL = url.parse(request.url, true);
var pathname = parsedURL.pathname;
if (pathname === "/admin/push") {
/* default mobile styling goes here.. */
/* then we progressively apply stylings for other widths */
/* Desktop */
@media (min-width: 767px) {
}
/* Tablets in Portrait */

Keybase proof

I hereby claim:

  • I am jahfer on github.
  • I am jahfer (https://keybase.io/jahfer) on keybase.
  • I have a public key whose fingerprint is 43C9 6189 2FA5 E5BE B1E3 CDEB 65B1 4B90 1BD7 3365

To claim this, I am signing this object:

@jahfer
jahfer / pubsub.swift
Created June 3, 2014 02:45
Simple pubsub implementation in Swift
// =====================================================
enum LogLevel: Int {
case Debug = 1, Info, Error
}
let log_level = LogLevel.Debug
protocol Loggable {
func log()
package main
import (
"encoding/json"
"io/ioutil"
"flag"
"strings"
"fmt"
)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAwHAzE57c+wKwpM/zZvuDFEYm9TQ+U7NcCwj2UHFupYWUEgf3sX/LU2H6VwbdJR0Xcgfr8GrrOiJha5gl+RkCEtfEYjcqw8uoO3plY+wAcJQwXeTYkP5Z21LDCE0E3cKcH9rRtA6J6i8QDrCNzi7rCSgm0kdubZfcJNZ/YICFPDGJEcfdElV1FNzABB85jDuvoVjP0vEPOZy3tG67YT9GcN8RfgkJmGCPRdgKHl7tYHxELANRlXf+7QawcosH9L7GoQOpi9nia5wYMCGV3NhGcwKdDmxWgLhmYD/smGOaEGh/Dt9i9DD9QMZ6gOF1/9OX5SrKzab2rYo6L+YBNs5V jahfer@github.com
@jahfer
jahfer / init.el
Created September 15, 2014 16:49
;; Package
;; Managing extensions for Emacs is simplified using =package= which
;; is built in to Emacs 24 and newer. To load downloaded packages we
;; need to initialize =package=.
(require 'package)
(setq package-enable-at-startup nil)
(package-initialize)
@jahfer
jahfer / init.el
Last active August 29, 2015 14:09
Emacs config
;; Package
;; Managing extensions for Emacs is simplified using =package= which
;; is built in to Emacs 24 and newer. To load downloaded packages we
;; need to initialize =package=.
(require 'package)
(setq package-enable-at-startup nil)
(package-initialize)
@jahfer
jahfer / generator-to-map.js
Last active August 29, 2015 14:14
Messing with ES6 Map + Generator
const ENDKEY = Symbol('endOfMap');
function* simpleGen() {
let counter = 0
while (counter++ < 3) {
yield [counter, true]
}
yield [ENDKEY, false]
}