Skip to content

Instantly share code, notes, and snippets.

@osamutake
osamutake / Hello.java
Last active August 29, 2015 14:21
http://bufferings.hatenablog.com/entry/2015/05/06/000943 で紹介されていた「手続き型で典型的」かつ、かなりアレなコードを自分なりにリファクタリングしてみました。
public Result execute(Input in) {
try {
Integer productId = in.getSelected();
List<Integer> coinsInserted = in.getCoins();
checkInput(productId, coinsInserted);
List<Integer> coinsRefused = new ArrayList<>();
int deposit = calcDeposit(coinsInserted, coinsRefused);
Product product = dao.findById(productId);
@osamutake
osamutake / bootstrap-auto-dropdown-menu.js
Last active March 25, 2016 03:25
bootstrapのdropdownを自動開閉します
$(function(){
var $this;
var moving = false;
$('li.dropdown').on('mousemove', function(){
if (!moving) {
moving = true;
return;
}
$this = $(this);
@osamutake
osamutake / test_riot_js-rails_cleanup.sh
Created October 12, 2016 14:50
Shell scripts for testing riot_js-rails with various versions of sprockets
#!/bin/sh
# execute this script after testing the following scripts
cd ..
rm -r riot-test
rvm gemset delete riot-test
@osamutake
osamutake / bootstrap-carousel.html
Last active January 20, 2018 00:07
Implement <bootstrap-carousel> tag with Riot.js
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osamutake
osamutake / test-pyplot.ipynb
Created April 4, 2018 08:20
jupyterでPyplotを使う(python)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osamutake
osamutake / Collatz conjecture by julia.ipynb
Created April 5, 2018 05:57
Collatzの予想(角谷の問題)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osamutake
osamutake / test-cubature.ipynb
Last active April 6, 2018 12:13
Cubature を使って数値積分を行う
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osamutake
osamutake / julia-function-args.ipynb
Last active April 7, 2018 19:01
julia の関数について勉強
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.