Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Coding or something, probably

William Mathewson neanias

👨‍💻
Coding or something, probably
  • Edinburgh, UK
Block or report user

Report or block neanias

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
View Python_Primer.md

A basic exercise to help learn the basics of Python

A change dispenser

Write a programme for an automatic change dispenser. It will choose the correct coins to dispense based on the amount required. It should work like this:

  1. Prompt the user for a number between 0 & 99 (this represents the change due.)
  2. Output the correct number of 50p, 20p, 10p, 5p, 2p or 1p coins to dispense.
View pdfcolorsplit
#!/usr/bin/env python
# Python 2 and 3 compatible.
# Python program to take a pdf file, and split it into color and black
# and white part(s). Requires pdftk and one of gs and pdftoppm.
#
# Iain Murray, February 2010.
#
# Inspired by dvicoloursplit.py, Jeremy Sanders 2001, although written
# from scratch.
@neanias
neanias / BucketballRules.md
Created Feb 28, 2018
Rules for the RN game of bucketball
View BucketballRules.md

Bucketball Rules

Pitch

The pitch is usually an indoor hall. At either end of the pitch, there is a bench, but can be a gym mat depending on available equipment, upon which the bucket holder stands. There should be a small 'no-entry' zone in front of the bench that no attacker nor defender may enter. This may be signified using another mat or features of the pitch, such as a marked 'D'.

Teams

View longest_string.py
string = "abcadefzab"
longest_string = ''
current_string = ''
last_char = ''
for char in string:
if char >= last_char:
current_string += char
elif last_char > char:
View spotify.sh
running=$(pidof spotify)
if [ "$running" != "" ]; then
artist=$(playerctl metadata artist)
song=$(playerctl metadata title | cut -c 1-60)
echo -n "$artist · $song"
fi
@neanias
neanias / GoldenSyrupSponge.md
Last active Apr 4, 2017
Recipes for Golden Syrup Sponge in a slow cooker
View GoldenSyrupSponge.md
  1. Grease a bowl
  2. Make a sponge (See attached sponge mixture recipe)
  3. Pour a bunch of golden syrup into the bowl (A lot of Golden Syrup is encouraged, ask your dentist how much Golden syrup is too much and at least double it)
  4. Put the sponge mix on top
  5. Pop it in the slow cooker on high with a bit of water in the bottom
  6. Wait til it's cooked (Maybe 2 hours? "It was a long time" - Dhileas)
View keybase.md

Keybase proof

I hereby claim:

  • I am neanias on github.
  • I am neanias (https://keybase.io/neanias) on keybase.
  • I have a public key whose fingerprint is B654 B282 9032 4EEC 91DD 2320 1BFF 097B 7744 F6C2

To claim this, I am signing this object:

View regex.sh
echo '2017-03-10 14:08 <tbrb> ok i need to look at how to sed' | perl -pe 's/\d{4}-\d{2}-\d{2} \d{2}:\d{2} <\w+> //g'
#=> ok i need to look at how to sed
View regexp.rb
# I don't think the syntax highlighter likes this
Uri.regexp == /
([a-zA-Z][\-+.a-zA-Z\d]*): (?# 1: scheme)
(?:
((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*) (?# 2: opaque)
|
(?:(?:
\/\/(?:
(?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)? (?# 3: userinfo)
(?:((?:(?:[a-zA-Z0-9\-.]|%\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))? (?# 4: host, 5: port)
View table.md
Boys Girls
Will - P Dhileas - P
Jack - P Riva - P
Brendan - P Shannon - P
John - P Ning - P
Tim - P Michelle - P
Arthur - P Clare - P
Ned - P Andreea - P
You can’t perform that action at this time.