As configured in my dotfiles.
start new:
tmux
start new with session name:
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012 | |
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler" | |
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist | |
(function(host) { | |
function Crawler() { | |
this.visitedURLs = {}; | |
}; | |
apply plugin: 'eclipse' | |
apply plugin: 'idea' | |
apply plugin: 'java' | |
project.version = "1.0" | |
try { | |
new ByteArrayOutputStream().withStream { os -> | |
def result = exec { | |
executable = 'svn' |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.eclipse.jetty.server.Request; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.handler.AbstractHandler; | |
import java.util.zip.GZIPInputStream; | |
Server server = new Server(18811); | |
server.setHandler(new AbstractHandler(){ |
public static List<Map<String,String>> convert(ResultSet resultSet) throws SQLException { | |
List<Map<String,String>> rows = new ArrayList<>(); | |
while (resultSet.next()) { | |
int total_rows = resultSet.getMetaData().getColumnCount(); | |
Map<String,String> row = new HashMap<>(); | |
for (int i = 0; i < total_rows; i++) { | |
row.put(resultSet.getMetaData().getColumnLabel(i + 1).toLowerCase(), resultSet.getObject(i + 1).toString()); | |
} | |
rows.add(row); | |
} |
#!/bin/bash | |
echo -ne "\033[0;33m" | |
cat<<EOT | |
_oo0oo_ | |
088888880 | |
88" . "88 | |
(| -_- |) | |
0\ = /0 | |
___/'---'\___ |
# use C+b as escape key | |
escape ^Bb | |
# the following two lines give a two-line status, with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]' | |
# huge scrollback buffer | |
defscrollback 5000 |
As configured in my dotfiles.
start new:
tmux
start new with session name:
SSH_ENV="$HOME/.ssh/environment" | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent | |
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV" | |
echo succeeded | |
chmod 600 "$SSH_ENV" | |
. "$SSH_ENV" > /dev/null |
; Comments start with semicolons. | |
; Clojure is written in "forms", which are just | |
; lists of things inside parentheses, separated by whitespace. | |
; | |
; The clojure reader assumes that the first thing is a | |
; function or macro to call, and the rest are arguments. | |
; | |
; Here's a function that sets the current namespace: | |
(ns test) |