Skip to content

Instantly share code, notes, and snippets.

View thash's full-sized avatar
🌵
⭐️ ⭐️ ⭐️ ⭐️ ⭐️

Takuya Hashimoto thash

🌵
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@kohyama
kohyama / puyo.clj
Last active October 19, 2017 06:08
ぷよぷよ連鎖 in Clojure
;;; Copyright (c) 2013 Yoshinori Kohyama. Distributed under the BSD 3-Clause License.
(ns puyo
(:require [clojure.test :refer (with-test run-tests are)]
[clojure.set :refer (union)]
[clojure.string :as string]))
(with-test
(defn- fall-one [b s]
(->> (reverse b)
(apply map vector)
@taisukeoe
taisukeoe / UIDemoActivity.scala
Last active April 16, 2017 05:01
How to force to execute Future callback function in Android UIThread.
import scala.concurrent._
import ExecutionContext.Implicits.global
import android.util.Log
import android.widget.TextView
class UIDemoActivity extends Activity {
override def onCreate(bundle: Bundle) {
super.onCreate(bundle)
val tv = new TextView(this)
@taisukeoe
taisukeoe / Calculator.scala
Created September 1, 2014 15:43
某勉強会の予定を調整さんに投げる用プロジェクト
import com.github.nscala_time.time.Imports._
import annotation.tailrec
import org.joda.time.DateTimeConstants
object Calculator extends App{
val start = nextMonday(DateTime.now.toLocalDate)
val days = start :: Stream.iterate(start + 1.day)(_ + 1.day).takeWhile(_.getDayOfWeek != DateTimeConstants.MONDAY).toList
val result = days.map {
@sekia
sekia / ctmcp4.11.oz
Created February 4, 2015 04:46
CTMCP chapter 4 exercise 1 - 5, 6 - 9
% ex. 1
local B in
thread
B=true % 1
end
thread
B=false % 2
end
if B then % 3
{Browse yes} % 4