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
#!/usr/bin/env python | |
import os | |
import random | |
class Follower: | |
def __init__(self, starting_location, current_victim=None): | |
# `starting_location` is a string representing a file system path. | |
self.location = starting_location | |
self.current_victim = current_victim |
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
#!/usr/bin/env python | |
import os | |
import random | |
class Follower: | |
def __init__(self, starting_location, current_victim=None): | |
# `starting_location` is a string representing a file system path. | |
self.location = starting_location | |
self.current_victim = current_victim |
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
;;; Directory Local Variables | |
;;; For more information see (info "(emacs) Directory Variables") | |
((python-mode | |
(python-shell-virtualenv-path . "/Users/mdeboard/Envs/sumo"))) | |
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
#!/usr/bin/env python | |
from math import ceil, floor, log10 | |
ones = { | |
1: 'one', | |
2: 'two', | |
3: 'three', | |
4: 'four', | |
5: 'five', |
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
;; Version 1 | |
{:user {:plugins [[luminus/lein-template "2.9.10.74"]]} | |
:repl {:dependencies [[cider/cider-nrepl "0.15.0-snapshot"]]}} | |
;; Version 2 | |
{:user {:plugins [[luminus/lein-template "2.9.10.74"]] | |
:dependencies [[cider/cider-nrepl "0.15.0-snapshot"]]}} |
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
guestbook.db.core> (require '[guestbook.core :refer :all]) | |
nil | |
guestbook.db.core> (mount.core/start #'*db*) | |
ClassCastException mount.core.DerefableState cannot be cast to clojure.lang.IFn guestbook.db.core/eval4338/fn--4339 (core.clj:11) | |
guestbook.db.core> |
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
;; Running `clojure-jack-in' here | |
(ns guestbook.db.core | |
(:require | |
[conman.core :as conman] | |
[mount.core :refer [defstate]] | |
[guestbook.config :refer [env]])) | |
(defstate ^:dynamic *db* | |
:start (conman/connect! | |
{:datasource |
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
require('normalize.css/normalize.css'); | |
require('styles/App.css'); | |
require('codemirror/lib/codemirror.css'); | |
import React from 'react'; | |
import Paste from './Paste'; | |
import LanguageStore from '../stores/LanguageStore'; | |
import Constants from '../AppConstants'; | |
import { codemirror } from '../../cfg/base.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
create table mydata_real (id serial, date date, value text); | |
create table mydata_real_y2015 (check (date >= '2015-01-01' and date < '2016-01-01')) inherits (mydata_real); | |
create table mydata_real_y2016 (check (date >= '2016-01-01' and date < '2017-01-01')) inherits (mydata_real); | |
create function mydata_nope() returns trigger language plpgsql | |
as $f$ begin raise exception 'insert on wrong table'; return NULL; end; $f$; | |
create trigger mydata_nope before insert on mydata_real execute procedure mydata_nope(); | |
create view mydata as select * from mydata_real; |
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 flask import Flask, request, render_template | |
from flaskext.wtf import Form, FloatField, Required | |
app = Flask(__name__) | |
app.secret_key = 'b\xcaf\xde\xc3\xc6\xdc\x03\xf0ls\xd6\x08\xe7\x9a2\x02j\xdf\xa7n\xe5\xf4\xdd' | |
class ChangeForm(Form): | |
cost = FloatField("Total cost of item: $") | |
tender = FloatField("Amount tendered: $") | |