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
1. Project structure ( mkvirtualenv, startproject, startapp) | |
2. commit | |
3. Models - makemigrations, migrate | |
4. Admin | |
5. Enter in example data. | |
6. Views, Urls, a skeleton of templates. (extends base.html) | |
7. Commit | |
8. Templates (focus on variables) | |
9. Commit |
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
OViiiiiiVViii***:****::*********iiiiiiiiiiiVVViiViiiVVViVViVVVVVVVVVVVVVVVVVVVVV | |
iiiVViiiiiiii***:****:****i*****iiiiiiiiViiiiViViVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
iiiiViiiiiiii********::*:********iiiiiiiiiiiVViiVVVVVVVVVVVVVVVVVVVVVVViiiiiiiVV | |
iiiiiiiiiiiii********:::*******i***iiiiiiiiiViVVVVVViVVVVViiiiiiiiiiiiiiiiiiiiiV | |
ii*iiiiiiiiii*VV*****::*:::*****VEEEEOViiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii | |
ii*iiiiiiiiiiii*****:::*:***VEOEEMMEMMEEEEViiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii | |
VViiiiiiiiiiiii****:::::::*EOEEEEEEEEEEOEEEEiiiiiiiiiiiiiiiiiiiiiiiiiiiii*iiiiii | |
iiiiiiiiiiii*i*****::::::*OEEEEEEOVOEOEVVEEEMiiiiiiiiiiiiiii*iiiiii*ii*iiiiiiiii | |
iiiiiiiiiiiiiiii***::::::OEEEOOVOi~:*i:::iEEiOiiiiii*********iiiiiiiiii*ii*iiiii | |
iiiiiiiiiiiiii****:::::::OEME**::::~::***:VEVOi*i****i*******iii*iiiii**ii*iiiii |
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
-module(funs). | |
%%% SKI combinators | |
i(X) -> X. | |
k(X) -> | |
fun(F) -> X end. | |
s(F) -> | |
fun(G) -> |
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
(define (best-fit points) | |
;; Use least-squares estimation to find best fit line for given set of points | |
(let* ((sumx (apply + (map car points))) | |
(sumy (apply + (map cadr points))) | |
(sumxy (apply + (map (lambda (p) (* (car p) (cadr p))) points))) | |
(sumx2 (apply + (map (lambda (p) (* (car p) (car p))) points))) | |
(n (length points)) | |
(slope (/ (- sumxy (/ (* sumx sumy) n)) (- sumx2 (/ (* sumx sumx) n)))) | |
(y-int (/ (- sumy (* slope sumx)) n))) | |
(cons slope y-int))) |
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
(define (repeat num arg) | |
(let inner ((current 0)) | |
(if (>= current num) | |
#nil | |
(cons arg (inner (1+ current)))))) | |
(define (make-range-stream min-x max-x step-x) | |
(let inner ((x min-x)) | |
(cons x (delay | |
(if (or (eq? x #nil) (>= (+ step-x x) max-x)) |
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 datetime import datetime | |
from django.db.models import get_model | |
from django.contrib.sites.models import Site | |
def reindex_homepage(site_id=2010, num=50, async=False): | |
layout_ids = find_homepage_layout_ids(site_id) | |
return reindex(layout_ids, num, async) |
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
#!/bin/bash | |
function android_get_pkg() { | |
# Gets the name of the package | |
echo $(aapt dump badging $1 | | |
awk -F" " '/package/ {print $2}' | | |
awk -F"'" '/name=/ {print $2}' | |
) | |
} |
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
#!/usr/bin/python | |
""" | |
A program that counts the number of occurences of words in a file. | |
Plain text books without copyright can be obtained from Project Gutenberg: | |
http://www.gutenberg.org/ | |
run 'python counter.py' to see the number of occurrences of the top 200 | |
most commonly used words |
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
DEFSNG A-Z | |
CLS | |
SCREEN 12 | |
xp = 320 | |
yp = 240 | |
num = 12 | |
DO | |
cad = 360 \ num |
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 sed script to convert HTML slides for reveal.js to markdown | |
# Assumes @@@\n is used for slide separator, and Note: is used for slide notes | |
# | |
# N.B. - Don't use regexes for HTML...ever. This is just a quick intro to sed | |
# and works for 90% of my needs for slides written in HTML (well-formed). This | |
# breaks pretty crazily for nested HTML | |
# | |
# Usage: | |
# sed -f thisfilename filename.html > filename.md | |
/^ *$/d |