Skip to content

Instantly share code, notes, and snippets.

View siwells's full-sized avatar

Simon Wells siwells

View GitHub Profile
@siwells
siwells / gist:d0e8c60317cdd81286a1e80438cefc12
Created February 15, 2018 19:10
Morse Code Audio Example using Web Audio API
<!DOCTYPE html>
<html>
<meta charset="utf-8"/>
<head>
</head>
<body>
<button onclick="morseSounds();">Sound</button>
<script>
var context = null;
@siwells
siwells / dotastro_remote.ipynb
Created November 4, 2015 12:58 — forked from astrofrog/dotastro_remote.ipynb
Remote data access from Python - #dotastro - Day Zero
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@siwells
siwells / gist:ffb8885cc62c8a7572d6
Created September 25, 2014 14:32
Shellshock fix for Bash & sh on OS X
System Binaries
OS X 10.9.5 (the latest stable release at the moment) ships with Bash v3.2.51:
$ bash --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.
You can obtain and recompile Bash as follows, providing that you have Xcode installed:
@siwells
siwells / big-git-files.sh
Created June 12, 2014 18:03
An excellent shell script I found here: http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ that I wanted to keep for whenever an asshole commits huge files to our git repo.
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@siwells
siwells / daterange.sh
Last active December 26, 2015 08:19
Shell script for Bash on OS X to generate a range of dates given a start date and an end date in the YYYY-MM-DD format.
#!/bin/bash
currentDateTs=$(date -j -f "%Y-%m-%d" $1 "+%s")
endDateTs=$(date -j -f "%Y-%m-%d" $2 "+%s")
offset=86400
while [ "$currentDateTs" -le "$endDateTs" ]
do
date=$(date -j -f "%s" $currentDateTs "+%Y-%m-%d")
echo $date
@siwells
siwells / SH.logs_accesses.total+unique.sh
Created October 23, 2013 16:31
Short script to process SUPERHUB log files to count the total number of access and the unique number of access to the application between the supplied dates.
#!/bin/bash
currentDateTs=$(date -j -f "%Y-%m-%d" $1 "+%s")
endDateTs=$(date -j -f "%Y-%m-%d" $2 "+%s")
offset=86400
while [ "$currentDateTs" -le "$endDateTs" ]
do
date=$(date -j -f "%s" $currentDateTs "+%Y-%m-%d")
searchstring="INFO | $date"
@siwells
siwells / targets.md
Last active November 16, 2017 09:12
Partly an aspirational list, partly an aide memoire for when I am trying to decide where to send a piece of work... This is a useful list of journals, conferences, and workshops series that are important in my area of Artificial Intelligence research. Because of overlap with pedagogic aspects of argumentation and dialogue systems, this list also…
@siwells
siwells / hindex
Created May 17, 2013 16:34
A little script to retrieve and print my total number of citations, h-index, and i10 number from Google Scholar. Only prerequisite is BeautifulSoup which does the heavy lifting/HTML parsing.
import urllib2
from BeautifulSoup import BeautifulSoup
base_url = "http://scholar.google.co.uk/citations?"
link = "&"
lang = "en"
lang_str = "&hl=" + lang
user = "NJ4EZFwAAAAJ"
user_str = "user="+user
@siwells
siwells / gforth.rb
Created September 20, 2012 20:37
gforth homebrew formula -- works for me
require 'formula'
class Gforth < Formula
url 'http://www.complang.tuwien.ac.at/forth/gforth/gforth-0.7.0.tar.gz'
homepage 'http://www.jwdt.com/~paysan/gforth.html'
sha1 '5bb357268cba683f2a8c63d2a4bcab8f41cb0086'
def install
ENV.j1 # Parallel builds won't work
system "./configure", "x86_64-apple-darwin10.0.0"