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
package hello | |
import arrow.core.* | |
import arrow.typeclasses.* | |
import arrow.instances.* | |
import java.util.Collections.list | |
fun main(args: Array<String>) { | |
val a = ForOption extensions { | |
binding { |
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
#! env ruby | |
class CodeSignature | |
def initialize(args) | |
@args = args | |
end | |
def returns(klass) | |
@ret = klass | |
puts "CodeSignature: @args = #{@args.inspect}" | |
puts "CodeSignature: @ret = #{@ret.inspect}" |
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
class Dog(): | |
def __init__(self, name: str) -> None: | |
self.name: str = name | |
def bark(self) -> str: | |
return "Bow-wow (" + self.name + ")" | |
def test(): | |
# No mypy error, but causes Rutime error at next line!!! | |
dog = Dog(123) |
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
class Temperature | |
# @implements Temperature | |
private_class_method :new | |
def self.celsius(num) | |
new(num) | |
end | |
def self.fahrenheit(num) |
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
# `git log` TYPO to `gi tlog` | |
function gi() { | |
a1=${1#t} | |
shift | |
git $a1 $* | |
} |
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
class Optional | |
private_class_method :new | |
class << self | |
def some(value) | |
new(value, false) | |
end | |
def none | |
new(nil, true) |
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
- | ー | |
---|---|---|
~ | ~ | |
: | ー | |
; | っ | |
a | あ | |
ba | ば | |
bd | べん | |
be | べ | |
bh | ぶう | |
bi | び |
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 twitter4j._ | |
object Main { | |
def main(args: Array[String]): Unit = { | |
val tweet = args.mkString(" ") | |
val status = TwitterFactory.getSingleton().updateStatus(tweet) | |
println("status id = " + status.getId.toString()) | |
} | |
} |
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
ruby -p -e "gsub /\e\[\d{1,3}[mK]/, ''" < INPUT > OUTPUT |
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
require 'objspace' | |
module MemoryMesureable | |
extend ActiveSupport::Concern | |
included do | |
delegate :memsize_of, to: ObjectSpace | |
end | |
def memsize |