Skip to content

Instantly share code, notes, and snippets.

@hachy
hachy / Timer.js
Created October 4, 2017 04:55
Unity 制限時間30秒
#pragma strict
var second: float = 30;
var timer: Text;
function Start () {
timer = GetComponent.<Text>();
}
function Update () {
@hachy
hachy / scoreboard_1.png
Last active July 9, 2017 07:09
Screenshots
scoreboard_1.png
@hachy
hachy / .rubocop.yml
Last active September 27, 2018 02:26
entype(https://entype.herokuapp.com) でつかってるrubocop
AllCops:
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- 'vendor/**/*'
- 'bin/**'
@hachy
hachy / _first_page.html.haml
Last active February 26, 2017 06:50 — forked from manemone/_first_page.html.haml
v4.0.0-alpha.6 kaminari のページネーションリンクに Twitter Bootstrap 4 のスタイルを適用する ref: http://qiita.com/manemone@github/items/564c58ea59fb3450826c
%li.page-item.prev{ class: "#{'disabled' if current_page.first?}" }
= link_to (current_page.first? ? "#" : url), class: "page-link", "aria-label" => "First", :remote => remote do
%span{"aria-hidden" => "true"} «
%span.sr-only
= t('views.pagination.first').html_safe
@hachy
hachy / gemsort.rb
Created April 12, 2016 14:15
sort gems
text = <<"EOS"
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
gem 'unicorn'
gem 'bootstrap-sass'
gem 'faml'
@hachy
hachy / GitHubService.java
Created October 31, 2015 14:30
Retrofit sample
package com.example.retrofitsample;
import java.util.List;
import retrofit.Call;
import retrofit.http.GET;
import retrofit.http.Path;
public interface GitHubService {
@GET("/users/{user}/repos")
@hachy
hachy / MainActivity.java
Created October 31, 2015 09:40
Custom ListView Sample
package com.example.listviewsample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.ListView;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
@hachy
hachy / MainActivity.java
Created October 31, 2015 09:28
ListView sample
package com.example.listviewsample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
@hachy
hachy / sort_bm.rb
Created September 24, 2015 03:54
Benchmark: Sorting a two-dimensional array by last value in ruby
require 'benchmark'
ary = []
1000.times {
ary << ['hoge', rand(100)]
}
n = 1000
Benchmark.bm(25) do |x|
@hachy
hachy / ittf_bonus.rb
Created September 8, 2015 06:53
Calculate ITTF bonus points
module B
class << self
def b1
[72, 64, 56, 48, 40, 32, 24, 16, 8]
end
def b2
[54, 48, 42, 36, 30, 24, 18, 12, 6]
end