This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* scrollview | |
* | |
* Created by You on November 2, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* AppController.j | |
* scrollview | |
* | |
* Created by You on November 2, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# terminal | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " ☠ " | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
export PS1='\u@\h \W$(__git_ps1 "|")$(parse_git_branch)$ ' | |
#export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ ' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn current-iterations [projects-and-iterations] | |
(current-by | |
"Project" | |
(map (fn [[p [i]]] | |
{(-> p :project :name) | |
(-> i :iteration :stories)}) | |
projects-and-iterations))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn perfect-number? [x] | |
(and (> x 0) | |
(== (apply + (filter #(= (rem x %) 0) (range 1 (inc x)))) | |
x))) | |
(defn list-perfs [num] | |
(filter perfect-number? (range num))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn fact2 [x] | |
(let [x (if (<= x 1) 1 x)] | |
(apply * x (range 1 x)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns github-clj | |
(:use clojure.contrib.json.read) | |
(:require [clojure.http.client :as http])) | |
;; List all repose GET repos/show/:user | |
(defn auth-info [login token] | |
(http/url-encode {"login" login "token" token})) | |
(def base-url "http://github.com/api/v2/json/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns backup-user | |
(:use github-clj | |
[clojure.contrib.pprint :only [pprint]] | |
[clojure.contrib.shell-out :only [sh]]) | |
(:import [java.io File])) | |
(defn clone-repo [repo dir] | |
(sh "git" "clone" | |
(format "[email protected]:%s/%s.git" | |
(:owner repo) (:name repo)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns attendance.core | |
(:use karras.core | |
karras.collection | |
karras.sugar | |
compojure.core | |
ring.adapter.jetty | |
hiccup.core) | |
(:require [compojure.route :as route])) | |
(defn home [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest using-hooke | |
(let [count (atom 0)] | |
(defn log-create [f & args] | |
(let [result (apply f args)] | |
(when (= Company (first args)) | |
(swap! count inc)) | |
result)) | |
(add-hook #'create log-create) |