Skip to content

Instantly share code, notes, and snippets.

@cgag
cgag / gist:0afef1fe2bbd701de6ff
Created March 21, 2015 07:59
zsh config found on pastebin
alias ls='ls --tabsize=0 --literal --show-control-chars --color=always --human-readable'
alias grep='grep --color=auto'
alias cp='cp --interactive'
alias mv='mv --interactive'
alias rm='rm --interactive'
alias ll='ls -lhX'
alias la='ls -lAhX'
alias l='ll -S'
alias less='less --quiet'
alias df='df --human-readable'
@cgag
cgag / gist:f6304367a8625d800067
Last active August 29, 2015 14:06
plivo test
<Response>
<Dial callerId="18004321321">
<Number>16184021401</Number>
</Dial>
</Response>
@cgag
cgag / gruntfile.js
Created July 14, 2014 20:42
purescript psc gruntfile
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
psc: {
options: {
main: "Mymodule.Main",
modules: ["Mymodule.Main"]
},
@cgag
cgag / purescript-alert
Created July 12, 2014 22:54
purescript alert ffi
module FFI.Test where
import Control.Monad.Eff
import Debug.Trace
foreign import data Alert :: !
foreign import alert
"function alert(s) { \
\ return function() { \
@cgag
cgag / gist:8031034
Created December 18, 2013 22:33
nginx and compojure/jetty
102
103 server {
104 listen 80;
105 server_name bookmarking.curtis.io;
106
107 location / {
108 expires 24h;
109 proxy_pass http://localhost:3000/;
110 sendfile on;
111 proxy_redirect off;
...
(defroutes basic-routes
(GET "/" [] (str "<a href=\"/test\">test</a>"))
(GET "/test" [] (friend/authenticated (home/index))))
(defroutes all-routes
basic-routes
<other routes>)
@cgag
cgag / car.cpp
Created February 23, 2013 20:18
class Car {
private:
void top () {
printf(" ________________________");
printf(" / | \\");
printf(" / | \\");
printf(" / | \\");
@cgag
cgag / kibit.clj
Last active December 11, 2015 17:58
(ns kibbittest.core)
(if true
::test
nil)
===
Consider using:
(when true :user/test)
@cgag
cgag / recur.clj
Created January 9, 2013 14:29
Clojure recur example
(defn naive-sum [n]
(if (= n 0)
0
(+ n (naive-sum (dec n)))))
(defn recur-sum [n]
(loop [acc 0
cnt n]
(if (= cnt 0)
acc
@cgag
cgag / gist:3172590
Created July 24, 2012 20:51
wasdfwf
bash "restart storm processes" do
action :nothing
code <<-EOH
echo "Restarting storm processes"
jps | grep "worker\|supervisor" | awk '{print $1}' | xargs kill
EOH
end