Skip to content

Instantly share code, notes, and snippets.

View nmarley's full-sized avatar
🦀
我想吃一點點東西。

Nathan Marley nmarley

🦀
我想吃一點點東西。
View GitHub Profile
@nmarley
nmarley / txversion.go
Created July 12, 2018 04:11
Split 32-bit signed tx version field into version and type
package main
import "fmt"
func main() {
// set old (signed 32-bit) version
// var versionOld int32 = -987005808
var versionOld int32 = 2
// split into version and type fields (`type` is a reserved keyword in Go)
@nmarley
nmarley / output.txt
Created July 5, 2018 00:27
C++ -- output of modifying map in range-based for
$ git log -1 --oneline
f255aad (HEAD -> master, origin/master) add separator to break up output
$ g++ -std=c++11 range-for-modify.cpp
$ ./a.out
added = 1
added = 0
key = [2], value = [two]
key = [5], value = [five]
key = [7], value = [seven]
key = [13], value = [thirteen]
@nmarley
nmarley / .profile
Created June 25, 2018 01:08 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
commit 02eee15c3341e45f04a5aef424c9df39eff68796
Author: Nathan Marley <nathan.marley@gmail.com>
Date: Fri Jun 22 08:01:07 2018 -0700
space to change the checksum
diff --git a/src/ninja.key.js b/src/ninja.key.js
index b07bac4..25d6ef6 100644
--- a/src/ninja.key.js
+++ b/src/ninja.key.js
@nmarley
nmarley / Makefile
Created June 15, 2018 04:11
modern Makefile for CI/CD, etc, w/AWS ECR. "WA" is 2-letter country-code for Wakanda
# System setup
SHELL = bash
AWS_ACCOUNT_ID ?= 100000000001
AWS_REGION ?= wa-north-7
AWS_ACCESS_KEY_ID ?= AKIABLAHBLAHBLAHBLAH
AWS_SECRET_ACCESS_KEY ?= Z9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+
DOCKER_REGISTRY ?= $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
test: ## Run a basic test suite, currently just the PEP8 style check
@nmarley
nmarley / gist:e8549f5f61587f55c153a0fe44b69397
Created June 4, 2018 02:18
Git log show author & committer
git log --pretty="%H author: %an <%ae>, committer: %cn <%ce>"
@nmarley
nmarley / facebook-contact-info-summary.rb
Created March 23, 2018 03:44 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It dumps all cell phone call + SMS message + MMS records, plus a summary of each.
#
# Place this script inside the extracted Facebook data download folder
# alongside the 'html' folder.
#
@nmarley
nmarley / facebook-contact-info-summary.rb
Created March 23, 2018 03:44 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /usr/bin/env ruby
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
#
# It dumps all cell phone call + SMS message + MMS records, plus a summary of each.
#
# Place this script inside the extracted Facebook data download folder
# alongside the 'html' folder.
#
@nmarley
nmarley / Effective_Engineer.md
Last active February 8, 2018 02:21 — forked from rondy/Effective_Engineer.md
Effective_Engineer.md

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@nmarley
nmarley / ipfs-peer-id.js
Created November 24, 2017 23:50
JavaScript Example: Get IPFS PeerID via API using js-ipfs-api
const ipfsAPI = require('ipfs-api')
let ipfs = ipfsAPI('localhost', '5001')
ipfs.config.get('Identity.PeerID', (err, peerid) => {
if (err) { throw err }
console.log("PeerID = [" + peerid + "]")
})