Skip to content

Instantly share code, notes, and snippets.

View number23's full-sized avatar
🎯
Focusing

number23 number23

🎯
Focusing
View GitHub Profile
@kikofernandez
kikofernandez / handler.clj
Last active December 17, 2015 12:09
Small example of Compojure handler working with the LinkedIn API using REST Web Services.
(ns linkedin-clojure.handler
(:use compojure.core)
(:require [compojure.handler :as handler]
[compojure.route :as route]
[hiccup.page :as hpage]
[hiccup.form :as form]
[cheshire.core :as parse]
[ring.util.response :as response]
[clj-http.client :as client]))
@teropa
teropa / resources.md
Last active December 4, 2020 05:42
Clojure Resources

Tutorials

#!/usr/bin/tclsh8.5
#
# Usage: git-unmerged branch1 branch2
#
# Shows all the non-common commits in the two branches, where non-common
# commits means simply commits with a unique commit *message*.
proc getlog branch {
lrange [split [exec git log $branch --oneline] "\n"] 0 400
}
@number23
number23 / gist:4368396
Last active April 3, 2017 09:45
HK id card check digit
public boolean hkid_check_digit(String id){
if (id.matches("[A-Z]\\d{6}-[\\d|A]") == false) {
msgMgr.reportException("身份証號格式錯誤,X123456-X", true);
return false;
}
/*
* check digit, A=10, B=11, ... Z=35
* the 9th weight == 36, google: another one is 58.
*
@jasonrudolph
jasonrudolph / 00-about.md
Created September 21, 2012 18:42
Rough Notes from Strange Loop 2012
@mariussoutier
mariussoutier / Mail.scala
Created August 23, 2012 12:13
Sending mails fluently in Scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
colin:/tmp/ $ cat ~/.lein/profiles.clj
{
:1.2 { :dependencies [[org.clojure/clojure "1.2.0"]] }
:1.3 { :dependencies [[org.clojure/clojure "1.3.0"]] }
:1.4 { :dependencies [[org.clojure/clojure "1.4.0"]] }
}
colin:/tmp/ $ lein with-profile 1.3 repl
Performing task 'repl' with profile(s): '1.3'
nREPL server started on port 50952
@feng92f
feng92f / gist:2849163
Created June 1, 2012 05:37 — forked from zythum/gist:2848881
google收录的敏感词
@zythum
zythum / gist:2848881
Created June 1, 2012 04:50
google收录的敏感词
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#