Skip to content

Instantly share code, notes, and snippets.

@cgag
cgag / gist:0afef1fe2bbd701de6ff
Created Mar 21, 2015
zsh config found on pastebin
View gist:0afef1fe2bbd701de6ff
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'
View gist:f6304367a8625d800067
<Response>
<Dial callerId="18004321321">
<Number>16184021401</Number>
</Dial>
</Response>
@cgag
cgag / gruntfile.js
Created Jul 14, 2014
purescript psc gruntfile
View gruntfile.js
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
psc: {
options: {
main: "Mymodule.Main",
modules: ["Mymodule.Main"]
},
@cgag
cgag / purescript-alert
Created Jul 12, 2014
purescript alert ffi
View purescript-alert
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 Dec 18, 2013
nginx and compojure/jetty
View gist:8031034
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;
View tmp.clj
...
(defroutes basic-routes
(GET "/" [] (str "<a href=\"/test\">test</a>"))
(GET "/test" [] (friend/authenticated (home/index))))
(defroutes all-routes
basic-routes
<other routes>)
View car.cpp
class Car {
private:
void top () {
printf(" ________________________");
printf(" / | \\");
printf(" / | \\");
printf(" / | \\");
View kibit.clj
(ns kibbittest.core)
(if true
::test
nil)
===
Consider using:
(when true :user/test)
@cgag
cgag / recur.clj
Created Jan 9, 2013
Clojure recur example
View recur.clj
(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
View gist:3172590
bash "restart storm processes" do
action :nothing
code <<-EOH
echo "Restarting storm processes"
jps | grep "worker\|supervisor" | awk '{print $1}' | xargs kill
EOH
end