This file contains hidden or 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
| "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" + escape(value + ", New South Wales", "url") | |
| parseJson(value).results[0].geometry.location.lat | |
| parseJson(value).results[0].geometry.location.lng |
This file contains hidden or 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
| latch_pin = 2 | |
| gpio.mode(latch_pin, gpio.OUTPUT) | |
| gpio.write(latch_pin, gpio.LOW) | |
| result = spi.setup(1, spi.MASTER, spi.CPOL_HIGH, spi.CPHA_LOW, spi.DATABITS_8, 0) | |
| print(result) | |
| while true do | |
| for i=1,255,1 do | |
| print(i) |
This file contains hidden or 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
| -- lookup table mapping characters to bit representations | |
| lookup = { | |
| ["A"] = 0x0e9c, | |
| ["B"] = 0x8ee0, | |
| ["C"] = 0x00cc, | |
| ["D"] = 0x8ce0, | |
| ["E"] = 0x00dc, | |
| ["F"] = 0x009c, | |
| ["G"] = 0x06cc, | |
| ["H"] = 0x0e1c, |
This file contains hidden or 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
| ### BASIC SETUP | |
| # set pleasant tab stops | |
| cat <<EOF >~/.nanorc | |
| set tabsize 4 | |
| set tabstospaces | |
| EOF | |
| # dir for all python command line programs | |
| mkdir ~/programs |
This file contains hidden or 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 ~/programs | |
| # not a repository | |
| git status | |
| # so init a repository | |
| git init | |
| # note the __pycache__ folder | |
| # we don't want to version that |
This file contains hidden or 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
| # A class is a cookie cutter that can be used to stamp out instances | |
| # This class models a farm (well one with animals on it, at least) | |
| # This class inherits from "object" | |
| class Farm(object): | |
| def __init__(self, length, width, sheep, cattle, pigs, poultry): | |
| self.length = length | |
| self.width = width | |
| self.sheep = sheep | |
| self.cattle = cattle |
OlderNewer