Skip to content

Instantly share code, notes, and snippets.

View liquidz's full-sized avatar
👶
hello world!

Iizuka Masashi liquidz

👶
hello world!
View GitHub Profile
@liquidz
liquidz / core.clj
Created April 16, 2012 14:54
Clojure1.4 Reader Literals Test
(ns myreader.core
"Reader Literals Test"
(:require [clojure.string :as str]))
(defn debug-print
"Gauche debug print"
[x]
`(let [res# ~x]
(println "?=" res#)
res#))
@liquidz
liquidz / http.scala
Created March 3, 2010 11:02
OAuth Library for Scala
package com.uo.liquidz.http
import java.net.{URL, HttpURLConnection}
import java.io.{BufferedReader, InputStreamReader, BufferedWriter, OutputStreamWriter, IOException}
// ssl
import java.security.{KeyManagementException, NoSuchAlgorithmException, SecureRandom}
import java.security.cert.{CertificateException, X509Certificate}
import javax.net.ssl.{HttpsURLConnection, KeyManager, SSLContext, TrustManager, X509TrustManager}
import Simply._

core.typed: Annotation Patterns

core.typed dependencies: [org.clojure/core.typed "0.2.53"]

require: (require '[clojure.core.typed :as t])

Patterns

  • single param
(t/ann f1 [t/Str -> t/Str])
" 検索語を強調表示
set hlsearch
" j/k での移動量を3行に
map j 5<C-e>
map k 5<C-y>
" H/L でタブ移動
map H gT
map L gt
(ns foo.core
(:require
[clostache.parser :as clostache]
[cuma.core :as cuma]))
(def MAX_NUM 10000)
(defmacro time*
[expr]
`(let [start# (. System (nanoTime))
(ns fuga.core
(:require
[evalive.core :refer [evil]]
[clojure.string :as str]))
(defn- to-sym [x]
(symbol (name x)))
(defn- key-map->sym-map [m]
(into {} (map (fn [[k v]] [(to-sym k) v]) m)))
@liquidz
liquidz / notify_oauth_draft.js
Created June 12, 2012 09:10
Notify me OAuth2.0 draft updates every morning
// Initializing variables
var dayBaseTime = 5;
var oauthDraftUrl = 'http://tools.ietf.org/wg/oauth/draft-ietf-oauth-v2/';
// End of variables initializing
var isNull = function(x){
return (x === null || x === undefined);
};
@liquidz
liquidz / github_scold.js
Created June 9, 2012 05:54
Scold me if I didn't push to GitHub for 3 days
// Initializing variables
var githubAccessToken = 'GitHub Access Token';
var days = 3;
var message = 'GitHub: WOOOORK!!!!!';
// End of variables initializing
var isNull = function(x){
return (x === null || x === undefined);
@liquidz
liquidz / notify_weather.js
Created June 6, 2012 16:04
Notify me today's weather every day the first time I unlock my phone after 5 AM
// Initializing variables
var dayBaseTime = 5; // (day - 1) if before 5 AM
var weatherOption = {
location: 'Tokyo'
, locationtype: 'city'
, days: 0
};
(def fib
(map second (iterate (fn [[a b]] [b (+ a b)]) [0 1])))
; (1 1 2 3 5 8 13 21 34 55)
(println (take 10 fib))