This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Royal Mint": "http://www.royalmint.com/", | |
"e-petition: Put Alan Turing on the next £10 note": "http://epetitions.direct.gov.uk/petitions/31659", | |
"Jane Austen to be face of the Bank of England £10 note": "http://www.bbc.co.uk/news/business-23424289", | |
"Beards of Manchester": "http://beardsofmanchester.com/", | |
"Common Bar - Too Much Vino": "http://inkygoodness.com/blog/news/billy-presents-too-much-vino-common-bar-manchester/", | |
"Common Bar - The Common World": "http://thecommonworld.org/", | |
"Transport vs. Transportation": "http://grammarist.com/usage/transport-transportation/", | |
"Ubuntu Guake Changelog": "http://changelogs.ubuntu.com/changelogs/pool/universe/g/guake/guake_0.4.4-1ubuntu1/changelog", | |
"BBC Science Club": "http://www.bbc.co.uk/programmes/b03889v9", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for j = 0:120 | |
... | |
if rem(j,2) == 0 | |
yboat = yboat + 1 | |
else | |
yboat = yboat - 1 | |
end | |
... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from random import randint | |
import pygame | |
pygame.init() | |
#Initialise the screen | |
xmax = 600 #Width of screen in pixels | |
ymax = 600 #Height of screen in pixels | |
screen = pygame.display.set_mode((xmax, ymax), 0, 24) #New 24-bit screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsettings set com.canonical.Unity.Lenses remote-content-search none; if [ "`/usr/bin/lsb_release -rs`" \< '13.10' ]; then sudo apt-get remove -y unity-lens-shopping; else gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"; fi; echo | sudo tee -a /etc/hosts; echo 127.0.0.1 productsearch.ubuntu.com | sudo tee -a /etc/hosts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
puzzle = [24, 0, 12, 32, 0, 44, 23, 15, 0, 25, 24, 0, 33, 22, 0, 34, 21, 0, 15, 33, 22, 31, 12, 14, 0, 32, 15, 0, 24, 43, 0, 23, 15, 33, 42, 54, 0, 24, 0, 23, 12, 51, 15, 0, 32, 12, 42, 42, 24, 15, 14, 0, 43, 24, 53, 0, 44, 24, 32, 15, 43] | |
nums = product([1,2,3,4,5], repeat=2) | |
lets = [chr(n) for n in range(65, 91)] | |
combs = zip(nums, lets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dbus | |
import gobject | |
from dbus.mainloop.glib import DBusGMainLoop | |
def device_added_callback(device): | |
print 'Device %s was added' % (device) | |
def device_changed_callback(device): | |
print 'Device %s was changed' % (device) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from itertools import product | |
from random import choice | |
from time import sleep | |
import mcpi.minecraft as minecraft | |
mc = minecraft.Minecraft.create() | |
PX, PY, PZ = mc.player.getPos() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mcpi.minecraft as minecraft | |
from time import sleep | |
mc = minecraft.Minecraft.create() | |
mc.postToChat("Welcome to Minecraft Pi") | |
x, y, z = mc.player.getPos() | |
sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from energenie import switch_on, switch_off | |
from time import sleep | |
# turn a plug socket on and off by number | |
switch_on(1) | |
switch_off(1) | |
# turn a plug socket on, then turn off after 10 seconds | |
switch_on(4) | |
sleep(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' | |
access_token_secret = '' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) |