Skip to content

Instantly share code, notes, and snippets.

@inhies
inhies / ttest.go
Last active December 26, 2015 09:39
Parse all templates in the current directory and all sub directories, then executes the given template name. Run as `ttest <template name>`.
package main
import (
"fmt"
"html/template"
"os"
"path/filepath"
"strings"
)
@inhies
inhies / MaxFloat64.go
Created May 9, 2013 06:55
Returns the maximum value from any number of float64 values passed to it
func MaxFloat64(v ...float64) (max float64) {
for _, x := range v {
if x > max {
max = x
}
}
return
}
// Package trade provides generic interfaces and helper functions for working
// with assets.
package trade
import (
"time"
)
// A single order that has been placed, with timestamp if available
type Order struct {
@inhies
inhies / bitcoin.go
Created April 5, 2013 20:58
A simple test program for using my bitcoin package
package main
import (
"fmt"
"github.com/inhies/go-bitcoin"
"github.com/kylelemons/godebug/pretty"
)
var Conn bitcoin.Client
@inhies
inhies / MIT.md
Created March 26, 2013 03:13
Markdown formatted version of the MIT software license.

The MIT License (MIT)

Copyright (c) [year] [copyright holders]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

@inhies
inhies / optional-recovery.patch
Created March 26, 2013 02:52
This patch applies to the 'build' project in the android-4.2.2_r1 branch of AOSP and allows you to build flashable .zips without including the factory recovery.
From bdfb8228f5a8ddd541ddc401d7e5b87a7b43234b Mon Sep 17 00:00:00 2001
From: inhies
Date: Thu, 7 Mar 2013 08:43:24 +0000
Subject: [PATCH] Add option to prevent building of recovery image with OTA .zip
Change-Id: I604ddaaa79442465ff821b74259b947da23ae98a
---
core/Makefile | 7 +++++++
tools/releasetools/ota_from_target_files | 28 +++++++++++++++++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
@inhies
inhies / cjdnsgen.go
Created March 25, 2013 18:41
Generates the important bits of a cjdns configuration file and outputs it as JSON.
package main
import (
"code.google.com/p/go.crypto/curve25519"
"crypto/rand"
"crypto/sha512"
"encoding/json"
"fmt"
mathrand "math/rand"
"runtime"
@inhies
inhies / GPL.md
Last active December 15, 2015 00:18 — forked from jnrbsn/GPL.md
Markdown formatted version of the GPLv3 license.

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@inhies
inhies / markdown.vim
Last active December 14, 2015 20:39 — forked from ppanyukov/markdown.vim
A plugin for rendering markdown and loading it in your web browser for viewing. This has been modified a few times and this version is geared towards Ubuntu and the blackfriday markdown processor. To use, just open a markdown file in vim and press ,p (comma then p) and it will render it to an html file and load it in your default browser.
"
" While editing a Markdown document in Vim, preview it in the
" default browser.
"
" Author: Nate Silva
"
" To install: Place markdown.vim in ~/.vim/ftplugin or
" %USERPROFILE%\vimfiles\ftplugin.
"
" To use: While editing a Markdown file, press ',p' (comma p)
@inhies
inhies / pimping.md
Last active December 14, 2015 20:40
Soon to be blog post

title: Terminal colors for tmux, vim, and weechat tags: terminal, command line, vim, tmux, solarized date: 13 Mar 2013 13:26 AST image: htop.png

Solarized Terminal Colors