Skip to content

Instantly share code, notes, and snippets.

View raylee's full-sized avatar

Ray Lee raylee

View GitHub Profile
@raylee
raylee / install.sh
Created May 7, 2020 15:15 — forked from dzindra/install.sh
Raspberry PI read only filesystem with writable overlay
#!/bin/bash
cp overlay /etc/initramfs-tools/scripts/
echo "overlay" >> /etc/initramfs-tools/modules
mkdir /overlay /overlay/temp /overlay/base
update-initramfs -c -k `uname -r`
echo "initramfs initrd.img-`uname -r`" >> /boot/config.txt
echo "boot=overlay `cat /boot/cmdline.txt`" > /boot/cmdline.txt
@raylee
raylee / macapp.go
Created February 20, 2020 18:38 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@raylee
raylee / appify
Created January 26, 2020 23:35 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@raylee
raylee / sse.go
Created November 26, 2016 03:29 — forked from schmohlio/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@raylee
raylee / main.go
Created August 4, 2016 03:35 — forked from mschoebel/main.go
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@raylee
raylee / analyze.go
Created November 12, 2015 16:16 — forked from nf/analyze.go
'spent' script to log where time is spent
package main
import (
"bufio"
"fmt"
"os"
"regexp"
"sort"
"strconv"
"strings"