Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -eux
ARCH=${ARCH:-x86_64}
CORES=$(sysctl -n hw.ncpu)
GHC=${GHC:-7.4.2}
CABAL=${CABAL:-0.14.0}
PLATFORM=${PLATFORM:-2012.2.0.0}
[[ ! -d /usr/local/src ]] && mkdir -p /usr/local/src
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@andrwj
andrwj / Pebble.ino
Created February 22, 2014 13:58 — forked from southwolf/Pebble.ino
#include <string.h>
#include <ctype.h>
#include <SoftwareSerial.h>
// the Bluetooth Shield connects to Pin D9 & D10
SoftwareSerial bt(9,10);
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00};
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};
@andrwj
andrwj / .ctags
Created August 18, 2014 23:37 — forked from tebeka/.ctags
--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/
--regex-Go=/([a-zA-Z_][a-zA-Z0-9_]*)[ \t]*:=/\1/d,var/
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@andrwj
andrwj / spacemacs-cheshe.md
Created November 20, 2018 14:01 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@andrwj
andrwj / loading.org
Created November 23, 2018 08:34 — forked from TheBB/loading.org
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the

@andrwj
andrwj / mu4e-config-emacs
Created December 2, 2018 02:30 — forked from jackbaty/mu4e-config-emacs
My mail (mu4e) configuration section of .spacemacs
;; Mu4e ------------------------------------------------------------------------
;; Mail Mu4e
(require 'org-mu4e)
(setq mu4e-maildir "~/Mail")
(setq mu4e-user-mail-address-list '("[email protected]" "[email protected]") )
;;store link to message if in header view if nil - header query if t
(setq org-mu4e-link-query-in-headers-mode t)
@andrwj
andrwj / bash-array-shift.sh
Created February 2, 2019 09:47 — forked from Integralist/bash-array-shift.sh
Zsh and Bash Array Shift (remove first item from the Array)
array=(foo, bar, baz)
echo ${array[@]} # => foo, bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => baz
@andrwj
andrwj / fast-clojure-hello-world-using-graal-vm.md
Created March 1, 2019 15:31 — forked from asimjalis/fast-clojure-hello-world-using-graal-vm.md
How To Speed Up Clojure Hello World 100x Using GraalVM

How To Speed Up Clojure Hello World 100x Using GraalVM

Performance

Version Command Time (seconds)
Java time java -jar target/fastclj-1.0-standalone.jar 1.354
GraalVM time ./fastclj-1.0-standalone 0.014

Details