Skip to content

Instantly share code, notes, and snippets.

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

Takuya Hashimoto thash

🌵
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@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
@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 {
@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)
@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)
#! /usr/bin/env ruby
require "rubygems"
require "rb-skypemac"
require "readline"
include SkypeMac
def get_channels
res = Skype.send_(:command => "SEARCH RECENTCHATS")
res.sub! "CHATS ", ""
channels = res.split(", ")
:function! F()
let xs = [2]
let i = 3
while len(xs) < 100
if empty(filter(copy(xs), 'i % v:val == 0'))
call add(xs, i)
endif
let i += 1
endwhile
put =xs
nnoremap <buffer> <SID>[ghcmod] <Nop>
nmap <buffer> <Leader>h <SID>[ghcmod]
nnoremap <buffer> <silent> <SID>[ghcmod]y :<C-u>call <SID>paste_type_signature()<CR>
function! s:paste_type_signature()
try
let signature = expand('<cword>').' :: '.ghcmod#type()[1]
catch
return
endtry
@ktym
ktym / sparql.rb
Last active June 30, 2016 07:24
SPARQL query interface
#!/usr/bin/env ruby
require "rubygems"
require "net/http"
require "uri"
require "cgi"
require "json" # gem install json
class SPARQL
@melborne
melborne / README
Created August 7, 2012 11:42
Lack is a minified Rack just for study.
Lack is a minified Rack just for study.
@henrik
henrik / gist:3181718
Created July 26, 2012 12:15
Fix "unsupported new OS, trying as if it were 10.6-10.7" from reattach-to-user-namespace on Mountain Lion (probably in tmux).
# Start by checking if they fixed it upstream:
brew update
brew upgrade reattach-to-user-namespace
# If it says it's already installed, they haven't fixed it upstream. So do this:
# Edit the recipe:
brew edit reattach-to-user-namespace