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
# Simon game for the pocketmoneytronics Christmas trees | |
# By Rob! | |
# Public Domain and / or CC0 at your choice, share and enjoy! | |
import time | |
from time import sleep | |
from machine import Pin | |
from random import randint | |
game_states = { |
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
let x; | |
let y; | |
let XM=640.1; | |
let ZM=800; | |
let YM=700; | |
let tilt=20; | |
let ST; | |
let CT; | |
let maxY; |
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
from turtle import * | |
DIGITS = 1000 | |
def pi_digits(x): | |
"""Generate x digits of Pi. | |
Nicked from https://stackoverflow.com/a/54967370/9794932""" | |
k,a,b,a1,b1 = 2,4,1,12,4 | |
while x > 0: | |
p,q,k = k * k, 2 * k + 1, k + 1 |
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
class CountedPerson: | |
counter = 0 | |
def __init__(self, name): | |
self.name = name | |
print("Registered " + name) | |
CountedPerson.counter += 1 | |
print("There are " + str(CountedPerson.counter) + " people registered.") | |
mike = CountedPerson("Michael") | |
gabe = CountedPerson("Gabriel") |
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
* { | |
font-family: Avenir Next, Helvetica Neue, Arial, Sans; | |
} | |
div#logo { | |
font-size: 18px !important; | |
} | |
div#logo img.pin_logo { | |
content: url("https://bitbucket.org/Scottkillen/userstyles/raw/5cf55c08325d0c28a6f840b3fa5b93679cb52549/img/pin.png") !important; | |
width: 16px; | |
height: 16px; |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
body { | |
background-color: #262626 !important; | |
} | |
/* Bright text */ | |
td.title a:link, span.comment font, span.comment font a:link, u a:link, span.yclinks a:link, body:not([id]), | |
td:nth-child(2):not(.subtext) > a:link, input, textarea, p > a, a > u, .c00, .c00 a:link, | |
a[href="http://www.ycombinator.com/apply/"] { | |
color: #ccc !important; |
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
# Lets look at the "1 times table"... | |
table = 1 | |
# ... up to 23 | |
x = 23 | |
print("Try 1 (wrong)") | |
for number2 in range(2,x+1): | |
for i in range(2,int(number2 ** 0.5)): | |
if (number2 % i) == 0: | |
break |
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
def factorize(x): | |
"""Takes an integer. Returns a list of its prime factors.""" | |
fluffy = [] | |
boring = set() | |
for i in range(2, x+1): | |
if i not in boring: | |
fluffy.append(i) | |
boring = boring.union({j for j in range(i*i, x+1, i)}) | |
return [tardigrade | |
for tardigrade |
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
import time | |
from threading import Thread | |
class HoldDownOrchestrator(): | |
def __init__(self): | |
self.call = None | |
hold_down_singleton = HoldDownOrchestrator() | |
def hold_down(a_function, timer, *args, **kwargs): |
NewerOlder