Skip to content

Instantly share code, notes, and snippets.

View alistairstead3408's full-sized avatar

Alistair Stead alistairstead3408

  • Cambridge, UK
View GitHub Profile
#!/bin/bash
#
# This script traverses through a directory of pdf's scanned in Windows with default scanned names
# e.g. Image.jpg, Image (1).jpg etc
# It merges them in ascending order and outputs them in ./pdfs/
for i in $(find . -name "*" -type d);
do
STR=$i
NAME=${STR:2:${#STR}}
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
#Takes two character vectors
lev_dist_better <- function(s, t){
if(identical(s, t)) return(0)
if(length(s) == 0) return(length(t))
if(length(t) == 0) return(length(s))
#initialise v0 with a sequence from 0 to length of t + 1
previous <- seq(1, length(t) + 1, 1)
current <- c(rep(0, length(t) + 1))
define :mockingjay do
with_fx :reverb, room: 1, mix: 1 do
play 91, release: 0.7
sleep 0.6
play 94, release: 0.7
sleep 0.6
play 93, release: 0.7
sleep 0.6
play 86, release: 0.7
sleep 5
define :test do
with_bpm 120 do
use_synth :saw
31.times do
use_synth :prophet
play 49, release: 0.6
sleep 0.3
end
12.times do
use_synth :prophet
with_bpm 96 do
#Thread to do bass synth
in_thread do
play_pattern_timed [68, 68, 68], [0.6, 0.6, 0.4], release: 0.3
play_pattern_timed [66], [1.6], release: 0.3
play_pattern_timed [64, 64, 64], [0.6, 0.6, 0.4], release: 0.3
play_pattern_timed [63, 66],[0.8, 0.4], release: 0.3
end
#Main melody thread
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form>
<input type="text" name="FirstName"/>