This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
background: white; | |
text-align: center; | |
padding: 20px; | |
font-family: Georgia, serif; |
This file contains 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 'bcrypt' | |
require 'haml' | |
require 'sinatra' | |
enable :sessions | |
userTable = {} | |
helpers do |
This file contains 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
find . -name \*.java -exec sed -i 's/[ \t]*$//' '{}' ';' |
This file contains 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 | |
PKG=${1:?Usage: nmvn pkg} | |
PACKAGE=com.nopolabs.$PKG | |
mvn archetype:generate -DgroupId=$PACKAGE -DartifactId=$PACKAGE -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false | |
This file contains 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 coin.core) | |
(def no-change {1 0 5 0 10 0 25 0}) | |
(def coins [25 10 5 1]) | |
(defn count-change | |
[change] | |
(reduce | |
(fn [value coin] |
This file contains 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 | |
DEV_DIR=riak-1.2.1/dev | |
for i in 1 2 3 4 | |
do | |
PORT_PREFIX=99${i} | |
APP_CONFIG=${DEV_DIR}/dev${i}/etc/app.config | |
cp $APP_CONFIG $APP_CONFIG.bak | |
perl -pi -e "s/(pb_port,)\s*\d+/\1 ${PORT_PREFIX}1/" $APP_CONFIG | |
perl -pi -e "s/(http,.*127.0.0.1.*,)\s*\d+/\1 ${PORT_PREFIX}2/" $APP_CONFIG |
This file contains 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
composer.json | |
--- | |
{ | |
"require": { | |
"silex/silex": "1.0.*@dev" | |
}, | |
"autoload": { "psr-0": { "App": "./app" } } | |
} | |
This file contains 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
// Usage: mongo localhost:27017/test csvBuilder_example.js | awk 'NR > 3 { print }' > products.out | |
var c = db.products.find({}, { _id: 1, name: 1, type: 1, shipper: 1 }); | |
function printCsv(c) { | |
while (c.hasNext()) { | |
var r = c.next(); | |
print(csvBuilder(). | |
add(r._id). | |
add(r.name). |
This file contains 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
package test; | |
import org.apache.activemq.ActiveMQConnectionFactory; | |
import javax.jms.*; | |
public class Apollo { | |
public static void main(String[] args) throws JMSException { | |
String user = "guest"; |
This file contains 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
sudo apt-get install python-pygments && alias pcat="pygmentize -f terminal256 -O style=native -g" |
OlderNewer