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
| # from https://qiita.com/troter/items/f011f3bf5afa72749731 | |
| require 'stringio' | |
| require 'date' | |
| File.open(File.expand_path('~/.zsh_history')) do |f| | |
| escaped = StringIO.new | |
| # .zsh_historyのデコード | |
| f.to_enum(:each_byte).tap do |enum| |
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
| version: '2' | |
| services: | |
| mongodb: | |
| image: mongo:latest | |
| container_name: mongodb | |
| environment: | |
| - 'MONGODB_USER=user' | |
| - 'MONGODB_PASS=password!' | |
| volumes: |
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/ruby | |
| # 参考URL | |
| # http://www.mk-mode.com/octopress/2016/02/08/fr24-getting-flight-info/ | |
| require 'json' | |
| require 'open-uri' | |
| require 'timeout' | |
| require 'csv' |
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 controllers | |
| import play.api.mvc._ | |
| import utilities._ | |
| object Application extends Controller with ResultUtility { | |
| object DataStore { | |
| val filename = "hoge.gif" | |
| val contentType = "image/gif" | |
| val blobdata = "data".getBytes |
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 java.math.BigDecimal | |
| import java.math.MathContext | |
| def sqrt(a: BigDecimal, scale: Int): BigDecimal = { | |
| var x = new BigDecimal( Math.sqrt(a.doubleValue()), MathContext.DECIMAL64 ) | |
| if (scale < 17) { | |
| return x | |
| } |
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
| #!/bin/bash | |
| # commands | |
| GEM=/usr/bin/gem | |
| RAKE=/usr/bin/rake | |
| # const params | |
| TMP_DIR=/tmp/gem-native | |
| usage() |