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 random | |
class Bot(): | |
def __init__(self, money, n_tosses, odds): | |
self.money = money | |
self.n_tosses = n_tosses | |
self.odds = odds | |
def handle_toss(self, toss_result, bet_return): | |
pass |
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 microbit import * | |
import music | |
notes = ['A1', 'B1', 'C1', 'D1', 'E1', 'F1', 'G1', 'A2', 'B2', 'C2', 'D2', 'E2', 'F2', 'G2', 'A3', 'B3', 'C3', 'D3', 'E3', 'F3', 'G3', 'A4', 'B4', 'C4', 'D4', 'E4', 'F4', 'G4', 'A5', 'B5', 'C5', 'D5', 'E5', 'F5', 'G5', 'A6', 'B6', 'C6', 'D6', 'E6', 'F6', 'G6', 'A7', 'B7', 'C7', 'D7', 'E7', 'F7', 'G7'] | |
""" | |
for note in notes: | |
music.play('{}:4'.format(note)) | |
print('playing {}:4'.format(note)) | |
""" |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link href="https://fonts.googleapis.com/css?family=Didact+Gothic" rel="stylesheet"> | |
<style> | |
/* set the CSS */ | |
.line { | |
fill: none; | |
stroke: steelblue; | |
stroke-width: 1px; |
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 re | |
import random | |
def random_keyword(match): | |
keywords = match.group(1).split('|') | |
return random.choice(keywords) | |
r = re.compile(r'{([^}]+)}') | |
with open('comment.txt') as f: |
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
/* .bashrc */ | |
alias c="clear" | |
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' | |
alias r="gcc $1 && ./a.out" | |
/* .vimrc */ | |
color symfony | |
/* swap escape and caps lock */ | |
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' |
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 soundcloud | |
import os | |
import argparse | |
client = None | |
def parse_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("clientid", help="Client ID from SoundCloud") |