Skip to content

Instantly share code, notes, and snippets.

View ChristopherBiscardi's full-sized avatar
💭
Building stuff

Chris Biscardi ChristopherBiscardi

💭
Building stuff
View GitHub Profile
@ChristopherBiscardi
ChristopherBiscardi / core.clj
Created October 30, 2012 00:02 — forked from pitluga/core.clj
Braintree Clojure Example
(ns braintree-clj.core
(:import [com.braintreegateway BraintreeGateway Environment TransactionRequest Transaction$Type])
(:require [clojure.string :as s]
[hiccup.core :as hiccup]
[hiccup.page-helpers :as page-helper]
[noir.core :as noir]
[noir.request :as noir-req]
(:require [monger.collection :as mc]
[monger.conversion :as convert])
;; get distinct values from the posts collection for the field category.
(mc/distinct "posts" "category")
;; get distinct values from the posts collection for the field category with a query.
(mc/distinct "posts" "category" {:limit 5})
;; convert values to maps using an anonymous function
riak-2.0.0pre5 ./bin/riak console
11:13:19.118 [info] Application lager started on node nonode@nohost
11:13:19.118 [info] Checking /Users/chris/Resources/riak/riak-2.0.0pre5/bin/../etc/app.config exists... false
11:13:19.118 [info] Checking /Users/chris/Resources/riak/riak-2.0.0pre5/bin/../etc/vm.args exists... false
11:13:19.118 [info] No app.config or vm.args detected in /Users/chris/Resources/riak/riak-2.0.0pre5/bin/../etc, activating cuttlefish
11:13:19.341 [info] Adding Defaults
11:13:19.345 [info] Applying Datatypes
11:13:19.361 [info] Validation
11:13:19.364 [info] Applied 1:1 Mappings
11:13:19.367 [info] Applied Translations
@ChristopherBiscardi
ChristopherBiscardi / schema.xml
Created February 8, 2014 04:41
Solr/Yokozuna/Riak Search 2 Schema for GeoSpatial Indexing.
<?xml version="1.0" encoding="UTF-8"?>
<schema name="geotest" version="1.5">
<uniqueKey>_yz_id</uniqueKey>
<fields>
<field name="name" type="string" indexed="true" stored="true"/>
<field name="loc" type="location_rpt" indexed="true" stored="true" />
<!-- Begin Yokozuna Fields -->
<field name="_yz_id" type="_yz_str" indexed="true" stored="true" required="true" />
handleLogin :: Maybe T.Text -> Handler App (AuthManager App) ()
handleLogin authError = heistLocal (I.bindSplices errs) $ render "login"
where
errs = maybe noSplices splice authError
splice err = "loginError" ## I.textSplice err
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
ssl_certificate ssl-bundle.crt;
ssl_certificate_key ssl-private.key;
ssl_session_timeout 5m;
import Snap.Internal.Http.Types
( Response(rspStatus, rspStatusReason),
Request(rqClientAddr, rqClientPort, rqContentLength, rqContextPath,
rqCookies, rqHeaders, rqHostName, rqIsSecure, rqLocalHostname,
rqMethod, rqParams, rqPathInfo, rqPostParams, rqQueryParams,
rqQueryString, rqServerAddr, rqServerPort, rqURI, rqVersion),
Params,
Method(..),
HttpVersion,
HasHeaders(..),
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.provision "shell", path: "vagrant-android-build.sh"
config.vm.provider :virtualbox do |vb|

Keybase proof

I hereby claim:

  • I am ChristopherBiscardi on github.
  • I am chrisbiscardi (https://keybase.io/chrisbiscardi) on keybase.
  • I have a public key whose fingerprint is 9F05 CD1F 7DED 44B3 E466 E709 059F 9974 97E7 EBB4

To claim this, I am signing this object:

./rel/riak/bin/riak console
config is OK
-config /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/app.2014.04.01.00.11.10.config -args_file /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/vm.2014.04.01.00.11.10.args -vm_args /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/vm.2014.04.01.00.11.10.args
Exec: /vagrant/riak-riak-2.0.0pre20/rel/riak/bin/../erts-5.10.2/bin/erlexec -boot /vagrant/riak-riak-2.0.0pre20/rel/riak/bin/../releases/2.0.0pre20/riak -config /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/app.2014.04.01.00.11.10.config -args_file /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/vm.2014.04.01.00.11.10.args -vm_args /vagrant/riak-riak-2.0.0pre20/rel/riak/data/generated.configs/vm.2014.04.01.00.11.10.args -pa /vagrant/riak-riak-2.0.0pre20/rel/riak/bin/../lib/basho-patches -- console
Root: /vagrant/riak-riak-2.0.0pre20/rel/riak/bin/..
Usage: beam.smp [flags] [ -- [init_args] ]
The flags are:
-a size