Skip to content

Instantly share code, notes, and snippets.

View zeddee's full-sized avatar

Zed zeddee

View GitHub Profile
@zeddee
zeddee / keybase.md
Created October 9, 2017 02:27
Keybase proof

Keybase proof

I hereby claim:

  • I am zeddee on github.
  • I am zeddee (https://keybase.io/zeddee) on keybase.
  • I have a public key ASC2xWF-qZ4npl11Gjh1II5pLBdUR1lJBC92IEXAchReewo

To claim this, I am signing this object:

@zeddee
zeddee / IndexedDB101.js
Created December 12, 2017 09:24 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@zeddee
zeddee / bootstrap.sh
Created December 30, 2017 05:11 — forked from keo/bootstrap.sh
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup

Notes

Tips and Tricks of the Docker Captains

"Tips and Tricks of the Docker Captains", YouTube video, published by "Docker" on 3 Nov 2017. Available: https://www.youtube.com/watch?v=1vgi51f0tCk

On keeping containers small:

  • Alpine image.
  • If need Debian, there are the debian:-slim images.
  • Centos:6.9 is 70MB.
package main
import (
"fmt"
"os"
)
func main() {
for x, env := range os.Environ() {
fmt.Println(x, env)
// Attempting to write try-catch pattern
// with defer, panic, and recover in golang
// Built upon https://blog.golang.org/defer-panic-and-recover
package main
import "fmt"
func main() {
container()

Quick notes on Docker Logging

Can make use of docker logging features by symlinking log files to /dev/stdout and /dev/stderr. E.g.:

RUN ln -sf /dev/stdout /var/log/nginx/access.log &&\
    && ln -sf /dev/stderr /var/log/nginx/error.log
@zeddee
zeddee / html_tokens.go
Created January 2, 2018 08:56 — forked from xeoncross/html_tokens.go
A simple HTML doc parser in golang that sends the tokens we are looking for back to the caller over a channel.
package main
import (
"fmt"
"strings"
"golang.org/x/net/html"
)
func main() {
  • /save/ /edit/
    • should allow for more fields
    • main body
    • tags
    • notes on the right
    • list of links, with base_url on top
  • can this be integrated with hugo?
    • use hugo to render all the content?
    • have scraper push content into hugo/content/x folder?
  • build editor for hugo?