Skip to content

Instantly share code, notes, and snippets.

@yllan
yllan / gist:5581754
Last active December 17, 2015 08:39
MySQL check encoding
show FULL columns from wp_posts;
show table status;
SHOW VARIABLES LIKE 'character_set%';
SHOW VARIABLES LIKE 'collation%';
List(1,2,3).flatMap(List(2))
// <console>:8: error: type mismatch;
// found : List[Int]
// required: Int => scala.collection.GenTraversableOnce[?]
// List(1,2,3).flatMap(List(2))
implicit def f[A, B](b: B) = (x:A) ⇒ b
List(1,2,3).flatMap(List(2))
package main
import (
"fmt"
"net/http"
)
const lenDownload = len("/dl/")
func downloadHandler(w http.ResponseWriter, r *http.Request) {
@yllan
yllan / PerfumeDrawingTutorial.markdown
Created June 13, 2013 09:50
PerfumeDrawingTutorial

It's a stack-based language.

  • Special stack for graphics context
  • General stack
This file has been truncated, but you can view the full file.
2 1
4 1
6 2
8 1
12 3
16 1
24 4
30 6
32 1
36 6
@yllan
yllan / editor.md
Created August 7, 2013 08:12
線上 editor
@yllan
yllan / ws.scala
Last active December 20, 2015 19:29
Demonstrate a strange behavior of WS.
import scala.util._
import scala.concurrent._
import scala.concurrent.duration._
import play.api.libs.json._
import play.api.libs.ws._
case class GistFile(val filename: String, val content: String)
case class Gist(val token: String) {
  • 氣溫
  • 輻射
  • 二氧化碳濃度
  • 地震
  • 煙塵(懸浮微粒)
Process: WebProcess [2523]
Path: /System/Library/StagedFrameworks/Safari/WebKit2.framework/WebProcess.app/Contents/MacOS/WebProcess
Identifier: com.apple.WebProcess
Version: 8537 (8537.46.3)
Build Info: WebKit2-7537046003000000~1
Code Type: X86-64 (Native)
Parent Process: Safari [2520]
User ID: 501
Date/Time: 2013-08-11 00:16:56.881 +0800
@yllan
yllan / 1mm.md
Last active December 22, 2015 11:39

壓克力板 (Acrylic Board)

壓克力板的左右兩側邊框裡有裝設 LED,透過控制 PWM 可以混出不同的顏色,這難度不高。左右兩條不同的顏色可以混出漸層,符合 iPad 上的控制界面。

文字動畫效果 (Text Animation)

技術上探討一下各種可能性:

  • 發光在壓克力板之外,透過各種折射、反射等光學原理成像