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
import flask | |
import os | |
import psycopg2 | |
import psycopg2.pool | |
app = flask.Flask(__name__) | |
app.secret_key = '@1*V*vpVqqfyhCZ)s/`5>B^V]mJ85]We' | |
app.debug = True | |
pool = psycopg2.pool.SimpleConnectionPool( |
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
digraph g { | |
fontname = helvetica; fontsize = 10; | |
node [shape = record; fontname = helvetica; fontsize = 10]; | |
edge [fontname = helvetica; fontsize = 10]; | |
/* Documents */ | |
doc0 [label = "<f0> parent_id|<f1> children|<f2> hierarchy|<f3> name|<f4> region"]; | |
doc1 [label = "<f0> parent_id|<f1> children|<f2> hierarchy|<f3> name|<f4> region"]; |
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
digraph G { | |
fontname = helvetica; | |
fontsize = 10; | |
node [fontname = helvetica; fontsize = 10; style = filled; fillcolor = grey]; | |
edge [fontname = helvetica; fontsize = 10]; | |
subgraph cluster0 { | |
label = "document"; | |
c0 [label = "children\n(inbound)"; fillcolor = green]; | |
h0 [label = "hierarchy"]; | |
n0 [label = "name"]; |
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
psql -t -c "select key from media order by 1;" hikerpix > db.asc | |
s3cmd ls s3://{{your-bucket-path}} | sort > s3.asc | |
join -v 2 db.asc <(cut -c 55-74 s3.asc | sort -u) > orphans.asc | |
awk '{print $4}' s3.asc | grep -f orphans.asc > urls.asc | |
xargs -P 4 s3cmd del $1 < urls.asc |
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
file=$(basename "$1") | |
ext="${file##*.}" | |
file="${file%.*}" | |
declare -a vars=(120x120 114x114 80x80 72x72 58x58 57x57 50x50 29x29) | |
for v in ${vars[@]}; do | |
convert -resize $v $1 $file-$v.$ext | |
done |
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
(defn move-to-s3 [k f] | |
(s3/put-object :bucket-name s3-bucket | |
:key k | |
:file f) | |
(io/delete-file f)) | |
(defn upload [userid file] | |
(let [img-uuid (uuid) | |
exts [".orig.jpg" ".0.jpg" ".1.jpg"] | |
dims [[nil nil] [595 296] [180 120]] |
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
(ns guestbook.routes.home | |
(:use compojure.core) | |
(:use hiccup.core) | |
(require [me.raynes.conch :as conch] | |
[amazonica.aws.s3 :as s3] | |
[clojure.data.json :as json] | |
[noir.io :as io] | |
[clojurewerkz.cassaforte.query :as cql-query] | |
[clojurewerkz.cassaforte.client :as cql-client])) |
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
This is what people get when they mail you “offensive” stuff. | |
They layman wouldn’t know what’s going on and most glaringly there’s no “TEK Systems” or “Allegis” anything in here. | |
Just in case you hadn’t seen this before. | |
BTW the expression I used that got me filtered is increasingly common: | |
http://goo.gl/lcOHvG | |
http://goo.gl/Hm9T6k |
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
; Quick miniKanren-like code | |
; | |
; written at the meeting of a Functional Programming Group | |
; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic | |
; programming. The code is really quite trivial and unsophisticated: | |
; it was written without any preparation whatsoever. The present file | |
; adds comments and makes minor adjustments. | |
; | |
; $Id: sokuza-kanren.scm,v 1.1 2006/05/10 23:12:41 oleg Exp oleg $ |
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
#lang racket | |
;#lang web-server/insta | |
;(get-uri (calc g-i (car rings) cogs) (calc g-i (car (cdr rings)) cogs)) | |
(define rings (list 38 50)) | |
(define cogs (list 23 21 19 17 16 15 14 13 12 11)) | |
(define max-x (/ 55 11.0)) | |
(define axis (list 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0)) | |
(define nums->csv |
NewerOlder