Skip to content

Instantly share code, notes, and snippets.

View dmichael's full-sized avatar

David Michael dmichael

View GitHub Profile
# Single input, multiple converted outputs
trigger:
name: balance
params:
condition: '> 10'
action:
name: swap
params:
outputs:
- symbol: TUSD # required: any asset supported by our exchanges or inputs
swap(6000, BLOCK, BTC, 'account1')
duration(1 day)
limit(4.15)
@dmichael
dmichael / miner-template.js
Last active November 2, 2018 19:56
A grammar test
if balance(DASH) > 15
swap(70%, TUSD, 'account1') limit(154.30)
swap(25%, GUSD, 'account2') limit(155.20)
send(5%, 'savings')
@dmichael
dmichael / miner-template
Created November 2, 2018 02:53
A grammar test
if balance(BLOCK, BajWThUb9svYuPeQ5AzBni2aiyPxazhf31) > 15
pragma solidity ^0.4.11;
// This contract keeps all Ether sent to it with no way to get it back.
contract Pain {
function() payable {}
}
// So does this one
contract MorePain {
function payme() payable {}
$ go get github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
$ ipfs-swarm-key-gen > ~/.ipfs/swarm.key
@dmichael
dmichael / gist:5622511
Last active May 25, 2017 17:47
Struct copy/clone
package main
import "fmt"
type Cat struct {
name string
skill string
}
func main() {
// The dumb way to deal with SOAP requests
func userRequest(userId string) string {
template := soapify(userTemplate)
return fmt.Sprintf(template, userId)
}
func soapify(template string) string {
return fmt.Sprintf(soapTemplate, template)
}
{
"actions":[
{
"add":{
"index":"%s",
"alias":"%s",
"filter":[
{
"term":{
"meta.publish_records.timestamp":"%s"
# Thanks https://coderwall.com/p/khym-w
curl -s "http://someapi.com/json" | ruby -rawesome_print -rjson -e 'ap JSON.parse(STDIN.read)'