Skip to content

Instantly share code, notes, and snippets.

View OniDaito's full-sized avatar

Benjamin Blundell OniDaito

View GitHub Profile
togusa:~ oni$ brew --config
HOMEBREW_VERSION: 0.7
HEAD:
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit arrandale
OS X: 10.6.4
Kernel Architecture: i386
@OniDaito
OniDaito / imagestopdf.py
Created January 31, 2012 11:59
Images to PDF
#!/usr/bin/python
import sys
import os
import getopt
import tempfile
import shutil
import subprocess
from CoreFoundation import *
from Quartz.CoreGraphics import *

Come fork bombs, and fall on Slough It isn't fit for servers now No disk space I hear you howl rm minus rf

Come fork bombs and crash the machines Those air-conditioned, Windows XPs Dell Racks, Dell Blades, Dell Screens Dell Minds, Dell Invoices

Keybase proof

I hereby claim:

  • I am onidaito on github.
  • I am onidaito (https://keybase.io/onidaito) on keybase.
  • I have a public key ASCtK_wwbbJOA8pcRVCTnRaDznPTQ12Ca31UsW_d3bPYdgo

To claim this, I am signing this object:

# 3 atoms from the previous residue
# The first residue already has the first 3 atoms laid out
a = prev_res.a.clone()
b = prev_res.b.clone()
c = prev_res.c.clone()
d = @a
na = [@b,@c]
# Bond lengths, bond angles and torsions (already in radians, as extracted from the DB)
blengths = [1.53, 1.453, 1.325]
-- Searching an n'ary tree returning the char or null
-- Benjamin Blundell
-- me@benjamin.computer
--
-- https://www.reddit.com/r/haskellquestions/comments/3han54/how_do_you_flatten_a_nested_list_of_arbitrary/
module Main where
data Tree a = Leaf a | Branch a [Tree a] deriving (Show)
@OniDaito
OniDaito / grapher.pl
Created February 25, 2016 10:27
Cheeky IRSSI Level Bar Graph Script
use strict;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
use POSIX;
sub grapher {
@OniDaito
OniDaito / plague_doctor.ino
Created April 25, 2021 17:44
Plague Doctor Mask Arduino Gist
#include <FastLED.h>
#include <SoftwareSerial.h>
SoftwareSerial MyBlue(11, 12); // RX | TX
#define PIN_LEFT_EYE 3
#define PIN_RIGHT_EYE 4
#define LEFT_OFFSET 2
#define RIGHT_OFFSET -4
#define STRIP_SIZE 16
@OniDaito
OniDaito / gist:1cd3ee5efd3c6e8ebd3ece15a8d15238
Last active October 21, 2022 16:05
Minimising a set of distances between 4 points
/**
* ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
* █░███░██▄██░▄▄▄█░▄▄▄█░██░▄▄
* █▄▀░▀▄██░▄█░█▄▀█░█▄▀█░██░▄▄
* ██▄█▄██▄▄▄█▄▄▄▄█▄▄▄▄█▄▄█▄▄▄
* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
* @file solver.cpp
* @author Benjamin Blundell - k1803390@kcl.ac.uk
* @date 21/10/2022
* @brief Go through all centroids and create the best average
@OniDaito
OniDaito / test_custom_runner.py
Created July 5, 2023 07:56
platform.io script to alter the the Unity Tests to use Serial1 instead of Serial for the ATMega32u4
from platformio.public import UnityTestRunner
class CustomTestRunner(UnityTestRunner):
UNITY_FRAMEWORK_CONFIG = dict(
native=dict(
code="""
#include <stdio.h>
void unityOutputStart(unsigned long baudrate) { (void) baudrate; }
void unityOutputChar(unsigned int c) { putchar(c); }