Skip to content

Instantly share code, notes, and snippets.

Daniel Harper djhworld

Block or report user

Report or block djhworld

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
djhworld /
Created Dec 30, 2018
improved version
use std::collections::HashMap;
use std::io;
use std::io::BufRead;
struct Counter {
items: HashMap<String, usize>,
impl Counter {
fn new() -> Counter {
View count.go
package main
import (
type Counter struct {
uniqueItems map[string]int

Keybase proof

I hereby claim:

  • I am djhworld on github.
  • I am djhworld ( on keybase.
  • I have a public key ASBuDsFo40OPjQUbBHDIr1dXS_7QOXG7NGajhjKYUIzVnQo

To claim this, I am signing this object:

RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
# test devised by gordonDrogon
function testpin {
echo -n "Testing GPIO pin #$pin..."
gpio mode $pin in
public class BeadSort {
private static final int BEAD = 1;
public void sort(int[] array) {
int[][] abacus = populateAbacusAndWipeInput(array);
for (int pole = 0; pole < abacus[0].length; pole++) {
int poleRow = abacus.length - 1;
for (int currentRow = poleRow; currentRow >= 0; currentRow--) {
if (abacus[currentRow][pole] == BEAD) {
djhworld /
Created Oct 24, 2015
flash nexus 5 to newer android version
function prompt {
echo $1
read -p "Ready? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
echo "Quitting"
   WHERE `VERSION`='4.4.4' && `BUILD`='KTU84P' && `RECOVERY`='CUSTOM' && `ROOTED`=1 
         && `WANNA_KEEP_USERDATA`=1;

A manual OTA for rooted hammerheads, quasi.

djhworld / ngrams.go
Created Apr 11, 2014
Ngrams algorithm
View ngrams.go
package main
import (
func main() {
View seesaw-repl-tutorial.clj
; A REPL-based, annotated Seesaw tutorial
; Please visit for more info
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
djhworld / haskjure.clj
Created Sep 25, 2011
useful haskell functions that I can't seem to find in clojure
View haskjure.clj
(defn group [xs]
"splits its sequence argument into a list of lists of equal, adjacent elements."
(partition-by identity xs))
(defn zip [xs ys]
"makes a list of vector tuples, each tuple containing elements of both sequences occuring at the same position"
(map vector xs ys))
(defn lines [str]
"For a given string, split it into a vector using a newline terminator as a delimiter"
You can’t perform that action at this time.