A simple demo of boltdb.
Compare prefix and range scans with the levelup approach described in the Rod Vagg's article, LevelDB and Node: Getting Up and Running.
See also the intro articles/talks by ...
| package main | |
| import ( | |
| git "github.com/libgit2/git2go" | |
| "log" | |
| ) | |
| func credentialsCallback(url string, username string, allowedTypes git.CredType) (git.ErrorCode, *git.Cred) { | |
| ret, cred := git.NewCredSshKey("git", "/home/vagrant/.ssh/id_rsa.pub", "/home/vagrant/.ssh/id_rsa", "") | |
| return git.ErrorCode(ret), &cred |
| package main | |
| // mentioned in bleve google group | |
| // https://groups.google.com/forum/#!topic/bleve/-5Q6W3oBizY | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "github.com/blevesearch/bleve" | |
| "github.com/blevesearch/bleve/document" |
A simple demo of boltdb.
Compare prefix and range scans with the levelup approach described in the Rod Vagg's article, LevelDB and Node: Getting Up and Running.
See also the intro articles/talks by ...
| #!/usr/bin/env bash | |
| # | |
| # Generate a set of TLS credentials that can be used to run development mode. | |
| # | |
| # Based on script by Ash Wilson (@smashwilson) | |
| # https://github.com/cloudpipe/cloudpipe/pull/45/files#diff-15 | |
| # | |
| # usage: sh ./genkeys.sh NAME HOSTNAME IP | |
| set -o errexit |
| package com.datastax.spark.demo; | |
| import com.datastax.driver.core.Session; | |
| import com.datastax.spark.connector.cql.CassandraConnector; | |
| import com.google.common.base.Optional; | |
| import org.apache.spark.SparkConf; | |
| import org.apache.spark.api.java.JavaPairRDD; | |
| import org.apache.spark.api.java.JavaRDD; | |
| import org.apache.spark.api.java.JavaSparkContext; | |
| import org.apache.spark.api.java.function.FlatMapFunction; |
| // Simple proxy/forwarding server for when you don't want to have to add CORS during development. | |
| // Usage: node proxy.js | |
| // Open browser and navigate to http://localhost:9100/[url] | |
| // Example: http://localhost:9100/http://www.google.com | |
| // This is *NOT* for anything outside local development. It has zero error handling among other glaring problems. | |
| // This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023 |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| Session session = getSession(); | |
| //update | |
| Statement exampleQuery = QueryBuilder.update("keyspace","table").with(QueryBuilder.set("height", 180)) | |
| .and(QueryBuilder.set("width", 300)).where(QueryBuilder.eq("id", 5145924587302797538L)); | |
| session.execute(exampleQuery); | |
| //insert | |
| exampleQuery= QueryBuilder.insertInto("keyspace","table").value("id",12245L) | |
| .value("data",ByteBuffer.wrap(new byte[]{0x11})).ifNotExists(); |
| #coding=utf-8 | |
| __author__ = 'brody' | |
| """ | |
| auto deploying java web application | |
| command examples: | |
| fab deploy_live | |
| fab rollback_beta | |
| run 'fab -l' for more | |
| """ |
| # set prefix to control-f | |
| set -g prefix C-f | |
| #unbind system defined prefix | |
| unbind C-b | |
| # helps in faster key repetition | |
| set -sg escape-time 0 | |
| # start session number from 1 rather than 0 |