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
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
; Define a vector of vectors | |
(def input [[1,2,3],[1,3,4],[1,5,6]]) | |
; Calling the 'list' function on this: | |
user=> (list input) | |
; Gives us a single item list whose one and only member is this | |
; vector of vectors: | |
([[1 2 3] [1 3 4] [1 5 6]]) | |
; Mapping the 'list' function to input _applies_ |
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
# 1. Install GraphViz | |
chris@ubuntu:~/src$ sudo apt-get install graphviz | |
[sudo] password for chris: | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
libcdt4 libcgraph5 libgraph4 libgvc5 libgvpr1 libpathplan4 ttf-liberation | |
Suggested packages: |
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
clear | |
export PS1=$ | |
free="$(( $(vm_stat | awk '/free/ {gsub(/\./, "", $3); print $3}') * 4096 / 1048576)) MiB free" | |
echo \*\*\*\* bash $BASH_VERSION \*\*\*\* | |
echo | |
echo $free | |
echo | |
echo READY. |
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
(def input [[1,2,3],[1,3,4],[1,5,6]]) | |
(defn is-list-unique [input] | |
"Takes a list and returns first element if they are all the same and sum of elements if not" | |
(if (every? #{(first input)} (rest input)) | |
(first input) | |
(apply + input)) | |
) | |
(defn are-lists-unique [input] |
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
input = [[1, 2, 3], [1, 3, 1], [1, 4, 2]] | |
total = [0, 0, 0] | |
for i in range(0, 3): | |
for row in input: | |
if row[i] != input[0][i]: | |
total[i] = total[i] + row[i] | |
else: | |
total[i] = row[i] |
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
// dojo-release-1.8.3-src is installed in the same directory as this script | |
dojoConfig = { | |
baseUrl: ".", | |
packages:[{name: 'dojo', location: 'dojo'}], | |
deps:['dojo/request', 'dojo/date'] | |
}; | |
require('./dojo/dojo.js'); |
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
// dojo-release-1.8.3-src is installed in the same directory as this script | |
dojoConfig = { | |
baseUrl: ".", | |
packages:[{name: 'dojo', location: 'dojo'}], | |
deps:['dojo/request', 'dojo/date'] | |
}; | |
require('./dojo/dojo.js'); |
NewerOlder