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
$ cd foox | |
$ mkvirtualenv foox | |
New python executable in foox/bin/python | |
Installing setuptools, pip...done. | |
$ python setup.py install | |
running install | |
running build | |
running build_py | |
[... a bunch of install stuff ...] | |
$ foox -s 1 -cf 5 7 6 5 8 7 9 8 7 6 5 |
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
>>> class Foo: | |
... def __init__(self): | |
... super() | |
... | |
>>> x = Foo() | |
>>> |
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
Verifying that +ntoll is my openname (Bitcoin username). https://onename.com/ntoll |
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
while True: | |
scroll_string_image(StringImage('HELLO TRANSCODE!'),100) |
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 java.io.IOException; | |
import com.fluidinfo.*; | |
import com.fluidinfo.fom.*; | |
import com.fluidinfo.fom.Object; | |
import org.json.*; | |
public class fluidTest { | |
/** | |
* Some example code for using the Fluid Object Model (FOM) classes with |
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 feedparser | |
import httplib2 # This library allows you to make HTTP requests | |
# Defines the URL of the RSS feed for BoingBoing.net | |
RSS_FEED = "http://feeds.boingboing.net/boingboing/iBag" | |
# Create a new Http object and use it to make a request to get the feed | |
http = httplib2.Http() | |
# headers contains the result headers, boingboing_rss contains the feed itself | |
headers, boingboing_rss = http.request(RSS_FEED) |
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
# Untested and the result of a brain dump | |
from fom.mapping import Object, tag_value | |
# the list of users I'm interested in | |
users = ['ntoll', 'gridaphobe', 'terrycojones', 'jkakar', ] | |
# they all should have a username/foo/bar tag | |
path_template = '%s/foo/bar' | |
# the dict will have the key (for attribute name) and tag_value (for the tag) |
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
# Play a game of squeeky pong with a 1m (30 led) NeoPixel strip. :-) | |
from microbit import * | |
import music | |
import neopixel | |
np = neopixel.NeoPixel(pin1, 30) | |
def show_pixel(position, wait): |
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
# Light acuity game. A pixel will change on either the | |
# left or the right. Click the appropriate button within | |
# an ever decreasing amount of time to increase your score. | |
# The game is over when you get it wrong or don't answer | |
# in time. | |
# Based on an idea by Dave Gibbs. | |
# By Nicholas Tollervey, Feb. 2016. Released to the public domain. | |
from microbit import * | |
import random |
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 micropython import * | |
import random | |
dots = [ [0]*5, [0]*5, [0]*5, [0]*5, [0]*5 ] | |
while True: | |
dots[random.randrange(5)][random.randrange(5)] = 9 | |
for i in range(5): | |
for j in range(5): | |
display.set_pixel(i, j, dots[i][j]) | |
dots[i][j] = max(dots[i][j] - 1, 0) |
OlderNewer