As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/sh | |
set -e | |
# Example init script, this can be used with nginx, too, | |
# since nginx and unicorn accept the same signals | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/path/to/your/app/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
ENVIRONMENT=production |
/***************************************************************************** | |
* Copyright (c) 2011 Kenneth Waters | |
* | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
var countries = { | |
ae: 'United Arab Emirates', | |
ag: 'Antigua and Barbuda', | |
ai: 'Anguilla', | |
al: 'Albania', | |
am: 'Armenia', | |
ao: 'Angola', | |
ar: 'Argentina', | |
at: 'Austria', | |
au: 'Australia', |
class MyResource | |
include HTTParty | |
debug_output $stdout # <= will spit out all request details to the console | |
#... | |
end |
Install ElasticSearch and Java
1 wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2 sudo dpkg -i elasticsearch-1.0.1.deb
3 sudo update-rc.d elasticsearch defaults 95 10
4 sudo add-apt-repository ppa:webupd8team/java
5 sudo apt-get update
6 sudo apt-get install oracle-java7-installer
7 java -version
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
########################################################################################## | |
# use case: training a classifier | |
# | |
# Many systems classify documents by assigning “tag” or “category” fields. Classifying | |
# documents can be a tedious manual process and so in this example we will train a classifier | |
# to automatically spot keywords in new documents that suggest a suitable category. | |
curl -XGET "http://localhost:9200/products_fr/_search" -d' | |
{ | |
"query": { |