Skip to content

Instantly share code, notes, and snippets.

View alucky0707's full-sized avatar

Hoshinoma Araki alucky0707

View GitHub Profile
@alucky0707
alucky0707 / slicer.js
Last active December 15, 2015 20:28
Slice like Ruby for JavaScript
(function(exports) {
"use strict";
/**
* arr["1..3"]かarr["1,2,3"]という形式かを判断する
* @private
*/
function sliceInfo(str) {
var
@alucky0707
alucky0707 / file0.rb
Created April 4, 2013 21:05
RubyとPythonじゃデフォルト引数の値が評価されるタイミングが違うんだぜ ref: http://qiita.com/items/b8677ec1d692f074e66b
#スコープの関係でグローバル変数
$msg = "Hello, Before World!"
def say(str = $msg)
puts str
end
say #=> Hello, Before World!
$msg = "Hello, After World!"
@alucky0707
alucky0707 / file0.txt
Created February 28, 2013 12:02
obj+""≠obj.toString()≠String(obj)っていう話 ref: http://qiita.com/items/8d80ca107555489710ea
// obj.toString()
str = obj+"";
@alucky0707
alucky0707 / TwPost.hs
Created November 18, 2012 04:42
ConduitでTwitterにpostします
module Main where
{-# LANGUAGE OverloadedStrings #-}
import System.IO
import Control.Monad.IO.Class (liftIO)
import Codec.Binary.UTF8.String (encode)
import Data.ByteString
import Data.Conduit
import qualified Data.Conduit.Binary as CB