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
| # target: dist - Archive and deploy to local Immutant VM | |
| dist: | |
| lein immutant archive && \ | |
| scp target/charon.ima [email protected]:apps/ && \ | |
| scp resources/deployment/local.clj '[email protected]:.immutant/current/jboss/standalone/deployments/charon.clj' && \ | |
| ssh -t [email protected] "touch ~/.immutant/current/jboss/standalone/deployments/charon.clj.dodeploy" | |
| # target: help - Display callable targets. | |
| help: | |
| egrep "^# target:" Makefile |
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
| # Rails only allows databases local to your machine. If you run your databases in a VM | |
| # (and you should), then you need to add this | |
| namespace :db do | |
| def local_database?(config, &block) | |
| if config['host'].in?(['127.0.0.1', 'localhost', '172.16.12.102']) || config['host'].blank? | |
| yield | |
| else | |
| $stderr.puts "This task only modifies local databases. #{config['database']} is on a remote host." | |
| end |
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
| 07:16:13,507 ERROR [immutant.runtime] (pool-15-thread-1) Unexpected error occurred loading immutant.init #<ExceptionInInitializerError java.lang.ExceptionInInitializerError> | |
| 07:16:13,508 ERROR [org.jboss.msc.service.fail] (pool-15-thread-1) MSC00001: Failed to start service jboss.deployment.unit."charon.clj".immutant.core.application-initializer: org.jboss.msc.service.StartException in service jboss.deployment.unit."charon.clj".immutant.core.application-initializer: java.lang.ExceptionInInitializerError | |
| at org.projectodd.polyglot.core.AsyncService$1.run(AsyncService.java:52) [polyglot-core.jar:1.x.incremental.61] | |
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25] | |
| at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25] | |
| at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25] | |
| at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25] | |
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 com.larrystaton.datomic | |
| (:require [datomic.api :as d])) | |
| ;; (find-entity-id :person/name "Larry Staton" (d/db conn)) | |
| (defn find-entity-id | |
| "Query Datomic for the entity ID with ATTR and VAL in DBVAL" | |
| [attr val dbval] | |
| (ffirst | |
| (d/q '[:find ?e | |
| :in $ ?a ?v |
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
| \documentclass[12pt]{article} | |
| \usepackage[unboxed]{cwpuzzle} | |
| \pagestyle{empty} | |
| \usepackage{fontspec,xltxtra,xunicode} | |
| \defaultfontfeatures{Mapping=tex-text} | |
| \setmainfont[Scale=MatchLowercase,Mapping=tex-text]{HelveticaNeue} | |
| \begin{document} |
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
| $ lein slamhound src/charon/tasks/import_stuff.clj | |
| Can't find 'slam.hound' as .class or .clj for lein run: please check the spelling. | |
| Exception in thread "main" java.io.FileNotFoundException: Could not locate slam/hound__init.class or slam/hound.clj on classpath: | |
| at clojure.lang.RT.load(RT.java:443) | |
| at clojure.lang.RT.load(RT.java:411) | |
| at clojure.core$load$fn__5018.invoke(core.clj:5530) | |
| at clojure.core$load.doInvoke(core.clj:5529) | |
| at clojure.lang.RestFn.invoke(RestFn.java:408) | |
| at clojure.core$load_one.invoke(core.clj:5336) | |
| at clojure.core$load_lib$fn__4967.invoke(core.clj:5375) |
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
| curl -s http://www.youtypeitwepostit.com/api/ | json -a collection.items | json -a href | parallel curl -s {} |
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
| λ curl -v -H 'Accept: application/vnd.collection+json' http://www.youtypeitwepostit.com/api/ | |
| * About to connect() to www.youtypeitwepostit.com port 80 (#0) | |
| * Trying 50.17.185.176... | |
| * Connected to www.youtypeitwepostit.com (50.17.185.176) port 80 (#0) | |
| > GET /api/ HTTP/1.1 | |
| > User-Agent: curl/7.33.0 | |
| > Host: www.youtypeitwepostit.com | |
| > Accept-Encoding: deflate, gzip | |
| > Accept: application/vnd.collection+json | |
| > |
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
| class DealershipsResource < Webmachine::Resource | |
| def encodings_provided | |
| {"gzip" => :encode_gzip, "identity" => :encode_identity} | |
| end | |
| def allowed_methods | |
| %W[GET] | |
| end |
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
| require 'rubygems' | |
| require 'mechanize' | |
| FIRST_NAME = 'FIRST_NAME' | |
| LAST_NAME = 'LAST_NAME' | |
| PHONE = 'PHONE' | |
| EMAIL = '[email protected]' | |
| PARTY_SIZE = 2 | |
| SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' } |