Skip to content

Instantly share code, notes, and snippets.

View tf0054's full-sized avatar

Takeshi Nakano tf0054

  • Curious Technology GmbH
  • Berlin, Germany
View GitHub Profile
(ns com.thoughtworks.loganalysis.loganalysis
(:use
midje.semi-sweet
incanter.core
incanter.charts
clojure.test
clojure.contrib.str-utils
[clojure.contrib.duck-streams :only (read-lines)])
(:import org.joda.time.format.DateTimeFormat))
@spadgos
spadgos / gist:1427918
Created December 3, 2011 19:38
Broken lift
Disclaimer: We are not affiliated with GitHub in any way!
Random Hacks of Kindness Berlin, Dec 2011 #RHoKbln
Project: Broken Lifts
Next steps:
Backend team
create database with static data
@syou6162
syou6162 / example_of_character_unicode_block.clj
Created February 21, 2012 11:56
ClojureでJavaのUnicodeBlockを使って文字種を判定する方法について
;; see also http://java.sun.com/j2se/1.5.0/ja/docs/ja/api/java/lang/Character.UnicodeBlock.html
(import 'java.lang.Character$UnicodeBlock)
;; java.lang.Character$UnicodeBlock
(Character$UnicodeBlock/of \u3042)
;; #<UnicodeBlock HIRAGANA>
(map #(Character$UnicodeBlock/of %) "日本だ")
;; (#<UnicodeBlock CJK_UNIFIED_IDEOGRAPHS> #<UnicodeBlock CJK_UNIFIED_IDEOGRAPHS> #<UnicodeBlock HIRAGANA>)
@BrockA
BrockA / waitForKeyElements.js
Created May 7, 2012 04:21
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@ptaoussanis
ptaoussanis / gist:3045473
Created July 4, 2012 05:10
Change standard Timbre appenders to use println instead of atomic (buffering) printer
(let [new-fn (ƒ [{:keys [more] :as args}]
(apply println (prefixed-message args) more))]
(set-config! [:appenders :standard-out :fn] new-fn)
(set-config! [:appenders :standard-out-or-err :fn] new-fn))
@djpowell
djpowell / countdown1.clj
Created August 16, 2012 23:33
The Countdown number round with clojure.core.logic
(ns countdown1
(:use
[clojure.core.logic])
(:require
[clojure.string :as str]))
;; Attempt to solve the "Numbers Game" from the UK Channel 4 gameshow
;; countdown.
;; Basically, 6 random numbers are chosen; then a random target is
@plaster
plaster / gist:4363770
Last active February 18, 2017 06:54
Clojureのダイナミックスコープと`Var/setDynamic`

https://gist.github.com/4357479 で「ダイナミックスコープな変数であるかどうか」をプログラムから(というかreplから)知る方法について調べた経緯です。

*print-readably* を対象にして調べる途上で出会ったいろいろなものについて、とりとめなくgdgdに書いています。

var

replで *print-readably* だけみると、値については教えてくれますが、変数については教えてくれません。 さっきのしらべものの途中で見つけた http://d.hatena.ne.jp/athos/20111204/elephant_things_in_clojure#'fact の表記があったため、試してみたところ

pe-16.core=> #'*print-readably*
@rtrcolin
rtrcolin / jiraRefreshTickets.js
Last active January 8, 2024 13:59
Super simple Google Docs integration with Jira Issues/Tickets
// URL for Jira's REST API for issues
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/";
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true
var fetchArgs = {
contentType: "application/json",
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"},
muteHttpExceptions : true
};
@halcat0x15a
halcat0x15a / gist:5063351
Last active August 14, 2017 18:24
History with Zipper in Clojure

clojure.zipを使ったHistoryの表現

Stackを使ったHistory

よくある履歴機能の実装として、スタックを使ったものがあります。

(defrecord History [undo redo current])

(def history (partial ->History [] []))
@devoncrouse
devoncrouse / clean_audio.sh
Created May 7, 2013 17:02
Using Sox (http://sox.sourceforge.net) to remove background noise and/or silence from audio files (individually, or in batch).
# Create background noise profile from mp3
/usr/bin/sox noise.mp3 -n noiseprof noise.prof
# Remove noise from mp3 using profile
/usr/bin/sox input.mp3 output.mp3 noisered noise.prof 0.21
# Remove silence from mp3
/usr/bin/sox input.mp3 output.mp3 silence -l 1 0.3 5% -1 2.0 5%
# Remove noise and silence in a single command