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
@soasme
soasme / main.clj
Created September 25, 2014 23:31
(ns example.main
(:use [backtype.storm clojure config log]))
(defbolt split-sentence ["word"]
[tuple collector]
(let [words (.split (.getString tuple 0) " ")]
(doseq [w words]
(emit-bolt! collector [w] :anchor tuple))
(ack! collector tuple)))
@philandstuff
philandstuff / euroclojure2014.org
Last active September 18, 2025 20:18
Euroclojure 2014

EuroClojure 2014, Krakow

Fergal Byrne, Clortex: Machine Intelligence based on Jeff Hawkins’ HTM Theory

  • @fergbyrne
  • HTM = Hierarchical Temporal Memory
  • Slides

big data

  • big data is like teenage sex
    • noone knows how to do it
    • everyone thinks everyone else is doing it
@qbg
qbg / core.cljs
Last active August 29, 2015 13:56
Editing weirdness
(ns om-tut.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state (atom {:text "Works", :data [{:text "Doesn't"}]}))
(defn handle-change
[e data edit-key owner]
@jsantell
jsantell / jpm-command.sh
Created January 13, 2014 21:01
Using `jpm init` to automatically enable node packages, adding to the dependencies and overload routes set up for what `jetpack-node` supports, which is a suite of `jetpack-*` dependencies (`package.json`). User can also add their own custom dependencies and overloads (`package2.json`)
$ jpm init
JPM info Running init on undefined
title: (My Jetpack Addon)
name: (my-jetpack)
version: (0.0.0)
Enable node packages? (yes)
description:
entry point: (index.js)
author:
engines (comma separated): (firefox,fennec)
(ns async-test.throttle.core
(:require [cljs.core.async :refer [chan close!o sliding-buffer]]
[clojure.string :as string])
(:require-macros
[cljs.core.async.macros :as m :refer [go alts!]]))
(def c (chan (sliding-buffer 1)))
(def loc-div (.getElementById js/document "location"))
(.addEventListener js/window "mousemove"
@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
@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 [] []))
@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
};
@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*
@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