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 test.api.add-user-test | |
(:use [zolodeck.utils.debug] | |
[zolodeck.demonic.schema] | |
[zolodeck.demonic.core :only [load-entity] :as demonic] | |
clojure.test | |
[clojure.pprint :only [pprint]]) | |
(:require [api.db.datomic-login :as login])) | |
(use '[datomic.api :only [q db] :as d]) | |
(def get-user login/get-user-couchdb-id) |
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 test.api.add-user-test | |
(:use [zolodeck.utils.debug] | |
[zolodeck.demonic.schema] | |
[zolodeck.demonic.core :only [load-entity] :as demonic] | |
clojure.test) | |
(:require [api.db.datomic-login :as login])) | |
(use '[datomic.api :only [q db] :as d]) | |
(def get-user login/get-user-couchdb-id) |
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 clojure-api.configvention | |
(:require [fs.core :as fs])) | |
(def config-files [ "../../../src/app.js.defaults.config.json" | |
"../../../src/app.js.config.json"]) | |
(defn load-config [] (map slurp config-files)) | |
throws error -> | |
------------------------------------------------------ | |
lib names inside prefix lists must not contain periods | |
[Thrown class java.lang.Exception] |
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
sending req to couchdb -> login | |
login req { url: 'http://localhost:5984/_session', | |
method: 'POST', | |
headers: { authorization: 'Basic cGF1bDox' } } |
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
cat file.txt | tr '\n' '|' > file.js |
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/env node | |
var configuration = require('configvention'); | |
var fs = require('fs'); | |
var express = require('express'); | |
var connect = require('connect'); | |
var app = express(); | |
var http = require('http'); | |
var request = require('request'); |
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
var express = require('express'); | |
var app = express(); | |
app.post('/my_route', require('./routes/my_route_handler.js')(magic_deps)); | |
app.listen(1337); |
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
exports.ninvoke = ninvoke; | |
function ninvoke(object, name /*, ...args*/) { | |
var args = array_slice(arguments, 2); | |
return napply(object[name], object, args); | |
} | |
exports.ncall = ncall; | |
function ncall(callback, thisp /*, ...args*/) { | |
var args = array_slice(arguments, 2); | |
return napply(callback, thisp, args); |
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 | |
rabbit_deb=rabbitmq-server_2.8.7-1_all.deb | |
wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.7/"$rabbit_deb" | |
dpkg -i "$rabbit_deb" | |
sudo apt-get -f install | |
rm "$rabbit_deb" | |
#rabbitmq wants this dir in ubuntu, but things should work without it exist | |
sudo mkdir /etc/rabbitmq/rabbitmq.conf.d |
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 | |
# These functions require a CouchDB instance, xdg-mime, curl, | |
trim() { | |
# Determine if 'extglob' is currently on. | |
local extglobWasOff=1 | |
shopt extglob >/dev/null && extglobWasOff=0 | |
(( extglobWasOff )) && shopt -s extglob # Turn 'extglob' on, if currently turned off. | |
# Trim leading and trailing whitespace |