Skip to content

Instantly share code, notes, and snippets.

View teaforthecat's full-sized avatar

Chris Thompson teaforthecat

View GitHub Profile
@teaforthecat
teaforthecat / project.clj
Created May 7, 2014 02:53
offending lein project file with dependencies configured to trigger a bug in clojurescript compilation. "NoSuchMethodError: com.google.common.io.ByteStreams.limit"
(defproject intrepid-life-coffee "0.1.0-SNAPSHOT"
:description "website to advertise the coffee shop"
:url "www.intrepidlifecoffee.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[compojure "1.1.6"]
[ring "1.2.1"]
[hiccup "1.0.5"]
;; [org.slf4j/log4j-over-slf4j "1.6.6"] ;;avoids dep loop
@teaforthecat
teaforthecat / gist:d5921a1516f27877ddda
Created July 13, 2014 01:50
broken upsert transaction
;; implicit upsert due to unique constraint on message
;; temp id will get replaced with real id if message exists
(defn upsert-message-tx [greeting]
(let [tempid (d/tempid :db.part/user -1 )]
[{ :db/id tempid
:greeting/message greeting}
[:inc tempid :greeting/hit-count 1]]))
@teaforthecat
teaforthecat / gist:85c518b3164445602334
Last active August 29, 2015 14:23
neat idea to bookmark commands
;; not working: service is not found in services;
(let ((service (prodigy-define-service
:name "* head *"
:cwd "~/.emacs.d/lisp"
:command "head"
:args '("my-functions.el")
))
)
(prodigy-start-service service))
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
[charset source w3m-ccl-write-euc-japan-character w3m-ccl-generate-ncr w3m-ccl-write-iso-latin-1-character defalias w3m-make-ccl-coding-system fboundp define-coding-system (lambda (coding-system mnemonic docstring decoder encoder) "Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER.\nCODING-SYSTEM, DECODER and ENCODER must be symbols.\nThis function is an interface to `define-coding-system'." (define-coding-system coding-system docstring :mnemonic mnemonic :coding-type ... :ccl-decoder decoder :ccl-encoder encoder)) #[(coding-system mnemonic docstring decoder encoder) "\305\306 \n \fB%\207" [coding-system mnemonic docstring decoder encoder make-coding-system 4] 7 "Define a new CODING-SYSTEM by CCL programs DECODER and ENCODER.\nCODING-SYSTEM, DECODER and ENCODER must be symbols.\nThis function is an interface to `make-coding-system'."] if r1 == 129 ((r1 = ...)) mule-unicode-0100-24ff 0 ((r1 = ...) (r0 &= 127) (r1 += ...)) mule-unicod
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
vboxnetadp
vboxnetflt
vboxdrv
ipv6
iptable_filter
ip_tables
x_tables
parport_pc
lp
parport
$ dd if=/dev/zero of=/dev/sdb
$ sfdisk -d /dev/sda | sfdisk /dev/sdb
$ fdisk /dev/sdb
Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
@teaforthecat
teaforthecat / ruby-change-block.el
Created July 16, 2011 11:19
elisp -ruby change block from do to {
(defun ruby-change-block()
(interactive)
(save-excursion
(let (beg end start-char end-char start-line end-line block-content one-liner)
(ruby-beginning-of-block)
(progn
(re-search-forward "do")
(backward-kill-word 1);; kill "do"
(setq beg (point)
mode server
tls-server
local xxx.xxx.xxx.xxx ## ip/hostname of server
port 1194 ## default openvpn port
proto tcp-server
dev tun
persist-key
client
dev tun
proto tcp
remote hostname 1194
resolv-retry infinite
nobind