This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % ex. 1 | |
| local B in | |
| thread | |
| B=true % 1 | |
| end | |
| thread | |
| B=false % 2 | |
| end | |
| if B then % 3 | |
| {Browse yes} % 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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(", ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require "rubygems" | |
| require "net/http" | |
| require "uri" | |
| require "cgi" | |
| require "json" # gem install json | |
| class SPARQL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Lack is a minified Rack just for study. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
NewerOlder