Skip to content

Instantly share code, notes, and snippets.

View pmn's full-sized avatar
🎯

Paul Nakata pmn

🎯
View GitHub Profile
@pmn
pmn / gist:1169588
Created August 24, 2011 23:36
Setting up noir-cljs
lein run
Starting server...
WARNING: Use of undeclared Var cljs.core/defn at line 15
WARNING: Use of undeclared Var cljs.core/truth_ at line 15
WARNING: Use of undeclared Var cljs.core/x at line 15
WARNING: Use of undeclared Var cljs.core/x at line 18
WARNING: Use of undeclared Var cljs.core/x at line 18
WARNING: Use of undeclared Var cljs.core/defn at line 20
WARNING: Use of undeclared Var cljs.core/type_satisfies_ at line 20
WARNING: Use of undeclared Var cljs.core/p at line 20
@pmn
pmn / gist:1164329
Created August 23, 2011 04:12
homepage
(ns pmn.views.main
(:use [noir.core :only [defpartial defpage]]
[hiccup.page-helpers :only [link-to]])
(:require [pmn.views.common :as common]))
(def links
[{:description "email: " :url"mailto:paul@pmn.org" :title "paul@pmn.org"}
{:description "twitter: " :url "http://twitter.com/icey" :title "@icey"}
{:description "readlater feed: " :url "http://twitter.com/pmn_" :title "@pmn_"}])
@pmn
pmn / gist:1164308
Created August 23, 2011 03:52
peeranoia source
(ns peeranoia.core
(:use [compojure.core :only [defroutes GET]]
[hiccup.core :only [escape-html html]]
[hiccup.page-helpers :only [include-css include-js html5]]
[ring.adapter.jetty :only [run-jetty]]
[ring.middleware.cookies :only [wrap-cookies]])
(:require [compojure.route :as route]
[compojure.handler :as handler]))
(defn- render-page
@pmn
pmn / gist:1145504
Created August 15, 2011 00:26
C# Comb Guid generation
// C# Comb Guid generation
// Found at http://stackoverflow.com/questions/665417/sequential-guid-in-linq-to-sql/2187898#2187898
Guid GenerateComb()
{
byte[] destinationArray = Guid.NewGuid().ToByteArray();
DateTime time = new DateTime(0x76c, 1, 1);
DateTime now = DateTime.Now;
TimeSpan span = new TimeSpan(now.Ticks - time.Ticks);
TimeSpan timeOfDay = now.TimeOfDay;
(deftest valid-emails
(are [email] (vali/is-email? email)
"testword@domain.com"
"test+word@domain.com"
"test_word@domain.com"
"test'word@domain.com"
"test`word@domain.com"
"test#word@domain.com"
"test=word@domain.com"
"test|word@domain.com"
@pmn
pmn / gist:878868
Created March 21, 2011 01:19
webmachine crashing
Erlang R14B02 (erts-5.8.3) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
=PROGRESS REPORT==== 20-Mar-2011::18:18:31 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.34.0>},
{name,alarm_handler},
{mfargs,{alarm_handler,start_link,[]}},
{restart_type,permanent},
{shutdown,2000},
public class TranslateAPI
{
private string TranslateURL { get; set; }
public TranslateAPI()
{
var appConfig = ConfigurationManager.AppSettings;
var baseurl = appConfig["TranslateBaseURL"];
var apiKey = appConfig["TranslateAPIKey"];