This file contains 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
gulp = require 'gulp' | |
sass = require 'gulp-sass' | |
uglify = require 'gulp-uglify' | |
minifyCss = require 'gulp-minify-css' | |
concat = require 'gulp-concat' | |
watch = require 'gulp-watch' | |
webserver = require 'gulp-webserver' | |
runSequence = require 'run-sequence' | |
gulp.task 'uglify', -> |
This file contains 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
require 'sqlite3' | |
favicon_path = File.join(ENV['HOME'], '/Library/Application Support/Google/Chrome/Default/Favicons') | |
db = SQLite3::Database.new favicon_path | |
begin | |
command = "delete from favicons where url like '%localhost%'" | |
db.execute(command) | |
p "Done: #{command}" | |
rescue SQLite3::BusyException => ex |
This file contains 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
class HogeController { | |
implicit var charFormat = new Writes[Char] { | |
def writes(c: Char): JsString = JsString(String.valueOf(c)) | |
} | |
} |
This file contains 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($){ | |
//フェードロールオ−バー | |
$(function(){ | |
$("img.roll").imgOvAnime(); | |
}); | |
$.fn.imgOvAnime = function(option){ | |
var o = $.extend({ | |
ovStr: "_o", | |
speed: 300, | |
type: "fade" |
This file contains 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
#!/bin/bash | |
# 1. Save as ~/bin/ssh-color | |
# 2. chmod 755 ~/bin/ssh-color | |
# 3. alias ssh='~/bin/ssh-color' | |
# 4. change host name | |
# 5. ssh {your host name} | |
set_color() { | |
local hex_fg=$1 | |
local hex_bg=$2 |
This file contains 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
package io.ShunsukeTadokoro | |
import org.hjson._ | |
import play.api.libs.json.Json | |
object HjsonSample { | |
def main(args: Array[String]) { | |
val hjson = |
This file contains 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 java.io.File | |
import com.github.tototoshi.csv.CSVWriter | |
object Mojibake extends App { | |
val f = new File("./mojibake-patterns.csv") | |
val writer = CSVWriter.open(f) | |
val targetString = "入れ替わってる〜!?" | |
val encodings = List("UTF-8", "EUC_JP", "Shift-JIS", "ISO-2022-JP") |
This file contains 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
// | |
// Disjunction - aka Scalaz Either | |
// \/[A, B] is an alternative to Either[A, B] | |
// -\/ is Left (usually represents failure by convention) | |
// \/- is Right (usually represents success by convention) | |
// Left or Right - which side of the Disjunction does the "-" appear? | |
// | |
// Prefer infix notation to express Disjunction Type v: String \/ Double | |
// | |
// References |
This file contains 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
// | |
// Validation[E, A] represents either: | |
// - Success[A] | |
// - Failure[E] | |
// | |
// Isomporphic to scala.Either[E, A] and scalaz.\/[E, A] | |
// | |
// Unlike \/[E, A], Validation is not a Monad, but an Applicative | |
// Functor. So if you want to use it as a Monad you can convert back | |
// and forth using the `validation` and `disjunction` method |
This file contains 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
"👨👩👧👧".replace("👩","👨"); |
OlderNewer