Skip to content

Instantly share code, notes, and snippets.

View neanias's full-sized avatar

William Mathewson neanias

View GitHub Profile
➜ yukibot git:(master) cabal install --only-dependencies
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: yukibot-0.0.0.1 (user goal)
next goal: base (dependency of yukibot-0.0.0.1)
rejecting: base-4.5.0.0/installed-40b... (conflict: yukibot => base>=4.7 &&
<5)
rejecting: base-4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0,
4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0,
4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires installed instance)
@neanias
neanias / gist:057348c63f6ea5c4b0b2
Created March 17, 2015 13:32
President Application blurb
I am a first year Computer Science student. I believe I am suitable as I am an active member of CompSoc, a regular face at TARDIS pub
meetings as well as being on the CompSoc IRC. I have thoroughly enjoyed being a member of CompSoc this year and so I would love to be
able to take on this fantastic society to even greater heights. My aims would be to try and keep alive the CompSoc culture that we
all know and love whilst also trying to expand the society and keep it being something that everyone can take part in.
I would like to have closer ties with Hoppers and Prewired, with perhaps making them SIGs within CompSoc if they are interested. In
relation to this, I would like to also try and establish connection to similar societies such as GameDevSoc and MathSoc, as well as
computing societies at other universities.
Having talked to some members of the society, I believe we should have more non-alcohol dependent socials; some ideas for this include
781 old man [#68388-#69168]
621 young lady [#112350-#112970]
575 old gentleman [#67050-#67624]
473 young man [#113014-#113486]
422 young gentleman [#111512-#111933]
396 old lady [#67925-#68320]
309 old woman [#70055-#70363]
283 long time [#54675-#54957]
253 last night [#46894-#47146]
241 great deal [#35038-#35278]
@neanias
neanias / restaurants-queries.txt
Created March 4, 2015 11:25
Answers to XPath queries
/ > cat //address
-------
<address>27 Marshall Street, Edinburgh, EH8 9BJ</address>
-------
<address>26 Potterow, Edinburgh, EH8 9BT</address>
-------
<address>7 Nicolson Square, Edinburgh, EH8 9BH</address>
-------
<address>55 West Nicolson Street, Edinburgh, EH8 9DB</address>
-------
public class Mode {
public static void main(String[] args) {
int[] dataset = new int[args.length];
int[] count = new int[10];
int mode;
for (int i = 0; i < args.length; i++) {
dataset[i] = Integer.parseInt(args[i]);
}
~ ⌚ 19:34:44
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr da:1f:52:45:d4:81
inet addr:185.17.149.144 Bcast:185.17.149.191 Mask:255.255.255.192
inet6 addr: 2001:1b40:3601:8:d81f:52ff:fe45:d481/64 Scope:Global
inet6 addr: 2001:1b40:3601:8:512c:8ac1:80b3:a738/64 Scope:Global
inet6 addr: fe80::d81f:52ff:fe45:d481/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:109702 errors:0 dropped:0 overruns:0 frame:0
TX packets:75583 errors:0 dropped:0 overruns:0 carrier:0
@neanias
neanias / virtualenv output
Last active August 29, 2015 14:11
virtualenv -p $(which python3) venv
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Failed to import the site module
Traceback (most recent call last):
File "/Users/williammathewson/Programming/Python/possel/venv/bin/../lib/python3.4/site.py", line 67, in <module>
import os
File "/Users/williammathewson/Programming/Python/possel/venv/bin/../lib/python3.4/os.py", line 616, in <module>
from _collections_abc import MutableMapping
@neanias
neanias / main.py
Last active November 3, 2016 22:26
AT Labs Backend in Python
from flask import Flask, request, Response
from twilio.rest import TwilioRestClient
from twilio import twiml
app = Flask(__name__)
account = 'Insert SID here'
token = 'Auth token'
client = TwilioRestClient(account, token)
@neanias
neanias / Gemfile
Last active November 3, 2016 22:27
AT Labs Backend
source 'https://rubygems.org'
gem 'sinatra'
gem 'twilio-ruby'
gem 'thin'
rotate :: Int -> [Char] -> [Char]
rotate k list | k >= 0, k <= length list = drop k list ++ take k list
| otherwise = []
makeKey :: Int -> [(Char,Char)]
makeKey n = zip xs ys
where
xs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -- You can use ['A'..'Z']
ys = rotate n xs