Skip to content

Instantly share code, notes, and snippets.

View chappjc's full-sized avatar
🏁

Jonathan Chappelow chappjc

🏁
View GitHub Profile
@chappjc
chappjc / dcrbuild.sh
Last active May 1, 2020 21:58
Decred build script using dep for both dcrd and dcrwallet
#!/usr/bin/env bash
# Build dcrd and dcrwallet from git.
# It will clone master initially; subsequently it will pull any checked out branch.
# chappjc
go version
GO111MODULE=on go get -v decred.org/dcrctl@master
# Inital setup for dcrd build with dep requries manual clone
@chappjc
chappjc / tasks-alt.json
Created June 11, 2016 17:19
Golang tasks for Visual Studio Code - 1
{
"version": "0.1.0",
"command": "bash",
"isShellCommand": true,
"showOutput": "always",
"args": [
"-c"
],
"tasks": [
{
@chappjc
chappjc / c_cpp_properties.json
Created January 17, 2017 23:25
VS Code C++ project properties for VS 2015 w/ Windows SDK 10.0
{
"configurations": [
{
"name": "Mac",
"includePath": ["/usr/include"],
"browse" : {
"limitSymbolsToIncludedHeaders" : true,
"databaseFilename" : ""
}
},
#!/bin/sh
/usr/local/letsencrypt/certbot-auto renew --noninteractive --standalone \
--pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx" \
--renew-hook "touch /etc/nginx/ssl/certsrenewed" --quiet --no-self-upgrade
EXITVAL=$?
if [ $EXITVAL -ne 0 ]; then
/usr/bin/logger -t certbot "certbot-auto exited abnormally with $EXITVAL"
exit $EXITVAL
fi
@chappjc
chappjc / jsonarray2csv.sh
Created February 24, 2017 00:29
convert JSON array to CSV
#!/bin/bash
in=`tee`
# echo $in
echo $in | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > $1
@chappjc
chappjc / handler.go
Created March 23, 2017 00:40 — forked from rjz/handler.go
Handle Github webhooks with golang
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"

Keybase proof

I hereby claim:

  • I am chappjc on github.
  • I am chappjc (https://keybase.io/chappjc) on keybase.
  • I have a public key whose fingerprint is 761D 6A0B EB28 6C9B 6A65 DD05 3F85 7EEA 746C 64D1

To claim this, I am signing this object:

@chappjc
chappjc / socket.html
Created May 18, 2018 22:58 — forked from oluwandabira/socket.html
Test page that connects to the insight socket.io backend and logs new transactions and blocks.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<script src="http://localhost:7777/js/socket.io.slim.js"></script>
<script>
var socket = io('http://localhost:7777', {path: '/insight/socket.io', transports: ['websocket'], upgrade: false});
//var socket = io('https://mainnet.decred.org/')
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="updates"></div>
<script src="https://alpha.dcrdata.org/js/socket.io.slim.js"></script>
<script>
var socket = io('https://alpha.dcrdata.org', {path: '/insight/socket.io', transports: ['websocket'], upgrade: false});
@chappjc
chappjc / dcrdex-swap.md
Last active April 7, 2020 23:33
dcrdex testnet DCR-BTC swap

The Trade

Maker sell 42 DCR for 0.42 BTC (0.01 BTC/DCR):

Taker sell, perfect match: