start new:
tmux
start new with session name:
tmux new -s myname
(require | |
'[pallet.crate.git :refer [git clone]] | |
'[pallet.crate.java :refer [java]] | |
'[pallet.crate.lein :refer [lein leiningen]]) | |
(def repo "git://github.com/jcrossley3/random-apps-of-kindness.git") | |
(def demo-directory "random-apps-of-kindness/demo") | |
(defplan setup-machine |
#!/bin/bash | |
HOSTS=(PUT, YOUR, HOSTS, HERE) | |
CMD="tail -f logs/api.log" | |
echo "Hit CTRL-C to stop" | |
sleep 0.5 | |
PIDS="" | |
for host in ${HOSTS[*]} | |
do |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
import Data.Aeson | |
import qualified Data.ByteString.Char8 as BS | |
import qualified Data.ByteString.Lazy.Char8 as BSL | |
import Data.ByteString.Lazy (toChunks) | |
import Data.List | |
import Data.Maybe | |
import Data.Typeable (Typeable) |
%% @author Bryan Fink | |
%% @doc formjson_resource takes x-www-form-urlencoded data and | |
%% re-encodes it as JSON. The data is expected as query | |
%% parameters for a GET, and request body for a POST. | |
%% | |
%% ``` | |
%% In: one=two&me=pope | |
%% Out: {"one":"two","me":"pope"} | |
%% ''' | |
-module(formjson_resource). |
/** | |
* Convert an instance of google.visualization.DataTable to CSV | |
* @param {google.visualization.DataTable} dataTable_arg DataTable to convert | |
* @return {String} Converted CSV String | |
*/ | |
function dataTableToCSV(dataTable_arg) { | |
var dt_cols = dataTable_arg.getNumberOfColumns(); | |
var dt_rows = dataTable_arg.getNumberOfRows(); | |
var csv_cols = []; |
(ns my.ns | |
(:use [korma.db]) | |
(:use [korma.core]) | |
(:require [clojure.java.jdbc :as sql])) | |
(def dbspec {:classname "org.h2.Driver" | |
:subprotocol "h2" | |
:subname "~/db/myapp" | |
:user "sa" | |
:password ""}) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?2.1.3"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.1.3"></script> | |
<style type="text/css"> |
package sample | |
import java.util.{TimerTask, Timer} | |
/** | |
* Shows Java way of creating an anonymous inner class to supply the code for a TimerTask. | |
*/ | |
object TimerDemo extends Application { | |
new Timer().schedule(new TimerTask { | |
def run() { |
{-# LANGUAGE OverloadedStrings #-} | |
-- This is a very simple example of parsing and generating json with Aeson, | |
-- by a haskell newbie and intended for newbies. | |
-- | |
-- This almost certainly contains a number of bad practices. It works for | |
-- me and hopefully will get you started. | |
-- | |
-- I couldn't find a stand-alone example of Aeson usage and found it tricky to | |
-- get going. For example, if you don't realize to enable the language extension |