Skip to content

Instantly share code, notes, and snippets.

View zeddee's full-sized avatar

Zed zeddee

View GitHub Profile
@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
@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() {
@zeddee
zeddee / main.go
Created January 6, 2018 16:42 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@zeddee
zeddee / traverse_node.go
Created January 20, 2018 21:01 — forked from xeoncross/traverse_node.go
Simple DOM node traversal in golang using a very useful collector/matcher function
package main
import (
"bytes"
"fmt"
"io"
"strings"
"unicode"
"golang.org/x/net/html"
@zeddee
zeddee / tweet_listener.py
Last active August 3, 2018 21:55 — forked from hugobowne/tweet_listener.py
Here I define a Tweet listener that creates a file called 'tweets.txt', collects streaming tweets as .jsons and writes them to the file 'tweets.txt'; once 100 tweets have been streamed, the listener closes the file and stops listening.
# forked from hugobowne/tweet_listener.py
class MyStreamListener(tweepy.StreamListener):
"""
Inheriting tweepy.StreamListener object class
Appears like we're doing this to add the
self.num_tweets and self.file attributes
to the initialization operator.
""""
def __init__(self, api=None):
@zeddee
zeddee / golang-tls.md
Created August 12, 2018 05:16 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
package main
import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
@zeddee
zeddee / .gitignore
Created October 18, 2020 05:27 — forked from kmorcinek/.gitignore
Example .gitignore file I use for C# projects
# The following command works for downloading when using Git for Windows:
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
#
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
#
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
# User-specific files