Skip to content

Instantly share code, notes, and snippets.

View hmsk's full-sized avatar
🍺
Now Brewing

Kengo Hamasaki hmsk

🍺
Now Brewing
View GitHub Profile
@grantland
grantland / README.md
Last active January 25, 2024 23:09
NextBus API
@JunichiIto
JunichiIto / alias_matchers.md
Last active May 28, 2024 12:04
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@tomykaira
tomykaira / extend.rb
Created July 6, 2014 08:24
The simplest webpay-extend application.
# -*- coding: utf-8 -*-
require 'sinatra'
require 'oauth2'
enable :sessions
# アプリケーション情報を持つクライアントオブジェクトを作成
client = OAuth2::Client.new('client_id', 'client_secret', :site => 'https://webpay.jp')
get '/' do
%Q{<a href="/request">テストアプリケーションを認可する</a>}
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@nobuoka
nobuoka / java-for-android-app.markdown
Last active May 19, 2024 09:11
Android アプリ開発勉強会のために書いた Java の入門文書

Android アプリ開発のための Java 入門

MEMO

  • declaration は 「宣言」 と訳しているが、「定義」 の方が適しているような気がしなくもない。
  • 「インスタンス」 と 「オブジェクト」 という言葉を使うことがあるが、本文書中ではどちらも同じ意味で使用している。
  • String オブジェクト」 という表現は、「String クラスのインスタンス」 を意味している。 (Java に限らず一般的な表現だと思う。)

はじめに

@joechrysler
joechrysler / who_is_my_mummy.sh
Last active May 14, 2024 12:26
Find the nearest parent branch of the current git branch
#!/usr/bin/env zsh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
# How it works:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@sorah
sorah / spec_helper.rb
Created December 17, 2012 01:34
Show warnings for examples that has no expectations
RSpec.configure do |config|
config.after(:each) do
result = self.example.metadata[:execution_result]
has_mock_expectations = RSpec::Mocks.space.instance_eval{receivers}.empty?
if !result[:exception] && !result[:pending_message] && !RSpec::Matchers.last_should && hasnt_mock_expectations
$stderr.puts "[WARN] No expectations found in example at #{self.example.location}: Maybe you forgot to write `should` in the example?"
end
end
end