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
.pc = $0801 "C64File" // Set the program counter to the start of BASIC memory | |
.word coffee // Link to the start of the program | |
.word 2021 // Link to the next line (dummy) | |
.byte $9E // BASIC token for SYS | |
.text "2061" // Address to call (2061 decimal = $080D) | |
.byte 0 // End of BASIC program | |
.pc = $080D // Continue program at $080D |
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
const puppeteer = require('puppeteer'); | |
let _browser; | |
let _page; | |
async function please_wait() { | |
console.log('you wait') | |
let you_wait = new Promise((resolve, reject) => { | |
setTimeout( function() { | |
console.log('time passes'); |
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
""" | |
Quick reminder of how decorators work | |
""" | |
from functools import wraps | |
def goat_inspect(f): | |
""" | |
^^^ this is the name of our decorator - interface | |
""" | |
@wraps(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
- hosts: localhost | |
gather_facts: False | |
sudo: no | |
tasks: | |
- name: Get my IP address | |
uri: url=http://icanhazip.com return_content=yes | |
register: ip_response | |
- name: Set my IP address |
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
10 PRINT "HAPPY XMAS "; | |
20 POKE 53280, 0 | |
30 POKE 54281, 0 | |
40 FOR X = 1 TO 500 | |
50 NEXT X | |
60 PRINT "HAPPY CHRISTMAS "; | |
70 POKE 53280, 2 | |
80 POKE 53281, 2 | |
90 FOR Y = 1 TO 500 | |
100 NEXT Y |
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
""" | |
Join two DataFrames together | |
""" | |
import pandas as pd | |
hist_1 = [ | |
{'bucket': '0-1', 'develop': 0}, | |
{'bucket': '2-4', 'develop': 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
Sub ColorMatchingCells(toMatch, color, topLeft, bottomRight) | |
' | |
' Colour in the different states in the Cumulative Flow Diagram | |
' | |
Range(topLeft, bottomRight).Select | |
'Cells.FormatConditions.Delete | |
Selection.FormatConditions.Add Type:=xlTextString, _ | |
String:=toMatch, _ | |
TextOperator:=xlContains |
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 os | |
import subprocess | |
import sys | |
import shutil | |
f = open("music.txt", "r") | |
dest_root = os.path.normpath('c:/Users/graham/Desktop/music') | |
src_root = os.path.normpath("d:/users/graham/music/itunes/itunes media/music/") |
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
# Grab the names of all Graham's files | |
import os | |
import sys | |
path = '.' | |
for dir in os.listdir(path): | |
if dir[0] > sys.argv[1]: | |
for dirpath, dirnames, files in os.walk(dir): |
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
""" | |
Demonstrate how to test dealing with 500 Internal Server Errors, | |
e.g. when raised by calling Google Spreadsheet API | |
via https://github.com/burnash/gspread, | |
by patching the object that raises them using mock. | |
""" | |
from mock import patch | |
import gspread |
NewerOlder