Skip to content

Instantly share code, notes, and snippets.

View allbinmani's full-sized avatar

origo allbinmani

  • Freelance
  • Sweden
View GitHub Profile
@allbinmani
allbinmani / Markov.java
Last active April 17, 2018 11:02
Markov in Java
import java.nio.file.Path;
import java.util.List;
import java.util.Random;
import java.util.ArrayList;
public class Markov {
/** Regular expression for breaking up words. */
private static final String WORD_REGEX = "(?<=\\w\\W)";
@allbinmani
allbinmani / rocket_parser.c
Last active November 5, 2017 19:18
GNU Rocket parser and binary/integer value converter
/**
rocket parser and binary/integer value converter
(c) 2017 orIgo / iNSANE^C!S
# Output File Format
The format can be made more compact, if required; if < 128 max keys with max 2 interpolation types, the interpolation type can be incorporated into the high bit of the row field.
Similarily, if less resolution is required for the value field, etc ..

Building the M680x0 LLVM backend

Thes instructions have been tested on OSX, but should work just as fine on Linux.

Requirements

Required:

- CMake
  • clang
@allbinmani
allbinmani / keybase.md
Created May 2, 2017 19:53
keybase proof

Keybase proof

I hereby claim:

  • I am allbinmani on github.
  • I am origo (https://keybase.io/origo) on keybase.
  • I have a public key whose fingerprint is 08B5 6BFE 913B 6B3F 0006 0709 49E1 A819 0A8C 591F

To claim this, I am signing this object:

@allbinmani
allbinmani / sqrttab_generator.js
Created April 10, 2017 19:46
A simple SQRT table generator
// A simple SQRT table generator
//
// Author: orIgo / iNSANE^C!S 2017
// License: Buy-Me-A-Beer License 1.0
//
// Produces a "stretched" sqrt table
// that fits in the range 0-RANGE
// and outputs an asm include file.
//
// Binary file generation is left
============= start.S ======================
.global start
.text
start:
lea.l _DemoBase(PC),a0
lea.l (PC,_DemoBase),a1
lea.l (_DemoBase,PC),a2
lea.l _DemoBase,a0
lea.l _DemoBaseEnd(PC),a3
@allbinmani
allbinmani / compiling_avrdude_6_on_raspbian.md
Created November 14, 2016 13:05
Step-by-step info for compiling / building / installing avrdude 6.1 on Raspberry Pi / Raspbian

Prerequisites

# apt-get install libusb-dev bison flex build-essential 

Download/extract avrdude source

# wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
# tar xfz avrdude-6.1.tar.gz
@allbinmani
allbinmani / grunt_task_shortify_require_js.js
Last active June 12, 2016 12:22
Grunt task to replace file names for require-statements with shorter names, reducing final file size slighty.
/**
* Grunt task to replace file names for require-statements with shorter names
* reducing final file size slighty.
*
* (C) 2016 mattias@allbinary, All Binary AB
*
* Example configuration:
* shortify_js: {
* build: {
* options: {
@allbinmani
allbinmani / setup_debian_docker.sh
Last active June 15, 2016 10:00
bash script to set up a new debian 8.2 with docker and docker-compose
#!/bin/sh
if [ -z $COMPOSE_VERSION ]; then
#1.8.0-rc1 exists
COMPOSE_VERSION=1.7.0
fi
if [ `whoami` = "root" ]; then
echo "Do not run as root!"
exit 2
@allbinmani
allbinmani / bling.js
Created April 22, 2016 16:21 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;