Skip to content

Instantly share code, notes, and snippets.

View diskshima's full-sized avatar

Daisuke Shimamoto diskshima

View GitHub Profile
@diskshima
diskshima / 0_reuse_code.js
Created August 26, 2014 01:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@diskshima
diskshima / helloworld-ja.md
Last active August 29, 2015 14:07
GitHub Guides Hello World (ja)

Hello World

Hello World はプログラミングの世界では伝統的なプロジェクトです。新しいものを学ぶときに始める簡単な課題です。GitHub の世界に飛び込みましょう!

GitHub は(プログラミングの)プロジェクトを仲間と一緒に進めるためのプラットフォームです。ハードディスク内のデータを失くしてしまうことや、複数のコンピュータ間でデータを管理することを心配しなくても大丈夫です。どこからでも同期できます!そして、何より、GitHub は非同期で仲間とソフトウェアを開発できます。

このガイドでは、 レポジトリ、ブランチ、コミット、イシュー、プルリクエスト などの GitHub の最も重要な部分をせつめいしていきます。

この知識をつかえば、いろいろなことができます。この、hello-world レポジトリはリソースやアイデアなどをためておく場所(未来レポジトリって読んだりします、jlord/hello-world がいい例です)にもなります。他の人と議論する場所にもなります(holman/feedback)。

@diskshima
diskshima / file0.css
Last active August 29, 2015 14:09
Metro アプリでフォントが使えない場合の対処法 ref: http://qiita.com/diskshima/items/602bdaf9800d6d36d7ab
@font-face {
font-family: "88ttf";
src: url("/fonts/88ttf.ttf") format('truetype');
}
@diskshima
diskshima / file0.rb
Created November 22, 2014 07:46
なぜか boolean の validates ~ presence がいつもエラーになる ref: http://qiita.com/diskshima/items/9c0b6286d68c0c13bb68
class Person < ActiveRecord::Base
validates :name, presence: true
end
@diskshima
diskshima / file0.erb
Last active August 29, 2015 14:10
Rails Best Practices の警告をちゃんと考える ref: http://qiita.com/diskshima/items/a19273f14705bbdb3e14
<% unless @member.name.present? %>
名無しの権兵衛
<% end %>
@diskshima
diskshima / rename_scss.sh
Created September 2, 2015 06:37
Shell script to rename .css.scss to .scss
#! /usr/bin/env bash
for f in $(find . -type f -iname '*.css.scss'); do
renamed=$(echo "${f}" | sed 's/.css.scss$/.scss/g')
cmd="git mv ${f} ${renamed}"
echo $cmd
eval $cmd
done
@diskshima
diskshima / gow.rb
Last active October 29, 2015 11:51
Script to open Git Repository's Remote URL
#! /usr/bin/env ruby
# Please run the below command first.
# gem install git uri-ssh_git launchy
require 'git'
require 'uri/ssh_git'
require 'launchy'
dir = '.'
@diskshima
diskshima / oauth2_tester.rb
Last active November 27, 2015 09:36
Command Line OAuth2 Tester
#!/usr/bin/env ruby
#
# oauth2_tester.rb
# Copyright (C) 2015 Daisuke Shimamoto <shimamoto@lifeistech.co.jp>
#
# Distributed under terms of the MIT license.
#
# Usage: ruby oauth2_tester.rb AUTHORIZATION_URL APP_ID APP_SECRET SCOPE
#! /usr/bin/env ruby
str = 'I, [2014-09-04T05:17:29.385333 #19220] INFO -- : Parameters: {"users"=>{"profile_url"=>"https://example.com/users/123", "status"=>"1"}}'
matches = /[DIWE], \[([0-9\-T:\.]+).* Parameters: ({.*)/.match(str)
matches.to_a.each_with_index do |m, index|
puts "#{index}: #{m}"
end

Keybase proof

I hereby claim:

  • I am diskshima on github.
  • I am diskshima (https://keybase.io/diskshima) on keybase.
  • I have a public key ASBYl3gH3ynqwnM2aGYVpo0BcHhv6A7JTpVtYJj3zgMUNgo

To claim this, I am signing this object: