Skip to content

Instantly share code, notes, and snippets.

View danielcompton's full-sized avatar

Daniel Compton danielcompton

View GitHub Profile
@danielcompton
danielcompton / hexml.sh
Created March 14, 2012 00:39
Shell script to convert hex encoded XML to cleanly formatted XML
#! /bin/sh
xxd -revert -plain $1 > /tmp/hexmltemp.xml
xmllint --format /tmp/hexmltemp.xml > $1
@danielcompton
danielcompton / gist:5582392
Last active June 5, 2018 15:48
List directory with up to 8 million files. Script taken from https://coderwall.com/p/h6rifq Download the file, compile it: gcc listdir.c -o listdir And use it like this: ./listdir [target dir] > target-ls.txt
#define _GNU_SOURCE
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#define handle_error(msg) \
@danielcompton
danielcompton / gist:6724333
Created September 27, 2013 04:53
Excel formula for calculating NZ tax paid on annual income.
=IF(B2<=14000,SUM(B2*10.5%),IF(B2<=48000,SUM(B2-14000)*17.5%+1470,IF(B2<=70000,SUM(B2-48000)*30%+7420,IF(B2>=70001,SUM(B2-70000)*33%+14020))))
@danielcompton
danielcompton / gist:6882330
Created October 8, 2013 09:51
Get diff stats for a commit, don't use a pager and send to a text file.
git --no-pager diff --stat HEAD b5f7df2 > diffstat.txt
@danielcompton
danielcompton / gist:7259186
Created November 1, 2013 00:03
Azure Recovery Services
The certificate specified is not associated with any Backup Vaults.Try a different certificate.
Verify that the public key of the certificate you want to use has been uploaded to the Windows Azure Backup Vault.
ID: 34508
@danielcompton
danielcompton / gist:7652031
Created November 26, 2013 01:32
Skuld test
Could not find artifact net.sf.josql:josql:jar:1.5 in central (http://repo1.maven.org/maven2/)
Could not find artifact net.sf.josql:josql:jar:1.5 in clojars (https://clojars.org/repo/)
Could not find artifact net.sf.josql:josql:jar:1.5 in restlet.org (http://maven.restlet.org)
Could not find artifact net.sf.josql:josql:jar:1.5 in fusesource.m2 (http://repo.fusesource.com/maven2)
Could not find artifact net.sf.josql:gentlyweb-utils:jar:1.5 in central (http://repo1.maven.org/maven2/)
Could not find artifact net.sf.josql:gentlyweb-utils:jar:1.5 in clojars (https://clojars.org/repo/)
Could not find artifact net.sf.josql:gentlyweb-utils:jar:1.5 in restlet.org (http://maven.restlet.org)
Could not find artifact net.sf.josql:gentlyweb-utils:jar:1.5 in fusesource.m2 (http://repo.fusesource.com/maven2)
@danielcompton
danielcompton / jstack 8048
Last active December 29, 2015 11:29
Skuld test on mbp
(master *)$lein test
Compiling 1 source files to /Users/Daniel/Developer/clojure/skuld/target/classes
lein test skuld.claim-test
2013-11-27 07:43:47,282 INFO org.apache.zookeeper.server.ZooKeeperServerMain: Starting server
2013-11-27 07:43:47,301 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
2013-11-27 07:43:47,301 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:host.name=daniels-13-mbp
2013-11-27 07:43:47,301 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:java.version=1.6.0_45
2013-11-27 07:43:47,301 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:java.vendor=Apple Inc.
2013-11-27 07:43:47,301 INFO org.apache.zookeeper.server.ZooKeeperServer: Server environment:java.home=/Library/Java/JavaVirtualMachines/1.6.0_45-b06-451.jdk/Contents/Home
@danielcompton
danielcompton / gist:7699946
Created November 29, 2013 00:31
Meitner deps count-queue
(pprint (unfold deps 'count-queue))
{count-queue
{clojure.core/update-in
{clojure.core/apply
{clojure.core/cons {},
clojure.core/list*
{clojure.core/cons {},
clojure.core/spread
{clojure.core/cons {},
clojure.core/first {},
@danielcompton
danielcompton / gist:9719633
Created March 23, 2014 06:48
Data Science Learning
- [ ] Math
- [ ] Linear Algebra
- [ ] Lay - Linear Algebra
- [ ] 18.06 Linear Algebra
http://www.scotthyoung.com/blog/mit-challenge/#more-link1806
- [ ] Burke Lecture Notes
http://www.math.washington.edu/~burke/crs/407/lectures/
- [ ] Coding The Matrix
http://www.amazon.com/dp/0615880991/?tag=coursera-course198-20
- [ ] Quantifying Uncertainty
(ns gol.core
(:refer-clojure :exclude [* - + == /])
(:require [clojure.core.matrix :refer :all]
[clojure.core.matrix.operators :refer :all]))
(def start [[0 0 0 0 0]
[0 0 0 0 0]
[0 0 1 0 0]
[0 0 0 0 0]
[0 0 0 0 0]]