Skip to content

Instantly share code, notes, and snippets.

View hsbt's full-sized avatar
🏠
Working from home

Hiroshi SHIBATA hsbt

🏠
Working from home
View GitHub Profile
@unak
unak / test-bundled-gem.rb
Created December 2, 2016 04:03
How to test bundled gems?
require "rubygems"
srcdir = File.expand_path("YOUR RUBY SOURCE DIRECTORY")
Dir.glob(File.join(srcdir, "gems", "*.gem")) do |gem|
tmp = File.basename(gem, ".gem").split(/-/)
version = tmp.pop
name = tmp.join('-')
spec = Gem::Specification.find{|s| s.name == name && s.version.version == version}
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@yhara
yhara / git.md
Last active September 10, 2016 07:50
CRuby git migration plan proposal (Draft)

CRuby git migration

This document proposes a plan to "migrate CRuby to git". The goal of this project is:

  • Provide git.ruby-lang.org and shutdown svn.ruby-lang.org

The slogan is "Do not try everything at once". The goal of this project does not include:

  • Using GitHub as centralized repository
@konk303
konk303 / test-queue.rb
Last active July 6, 2017 01:31
Simplified test-queue runner with simplecov
#!/usr/bin/env ruby
require 'test_queue'
require 'test_queue/runner/rspec'
class MyAppTestRunner < TestQueue::Runner::RSpec
def after_fork(num)
SimpleCov.command_name "worker#{num}"
ActiveRecord::Base.configurations['test']['database'] << num.to_s
ActiveRecord::Base.establish_connection(:test)
@bmcbride
bmcbride / google-form-to-github-issue.md
Last active September 11, 2024 08:13
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@nurse
nurse / chkbuild.yml.erb
Created September 13, 2015 18:02
template for chkbuild with serverkit
resources:
- type: package
name: zsh
- type: package
name: screen
- type: package
name: subversion
- type: group
name: <%= user %>
@exAspArk
exAspArk / friday_deploy_cap2.rb
Last active November 14, 2020 23:13
Friday deploy script for Capistrano
# Capistrano 2
before "deploy", "friday:good_luck"
namespace :friday do
friday_jumper = %{
┓┏┓┏┓┃
β”›β”—β”›β”—β”›β”ƒβŸ β—‹βŸ‹
┓┏┓┏┓┃ βˆ• Friday
β”›β”—β”›β”—β”›β”ƒγƒŽ)
@snoozer05
snoozer05 / gist:ca9860c57683e4221d10
Last active August 29, 2015 14:03
Ruby commit count until 2.1.0-p0
* 1: nobu 1870
* 2: akr 716
* 3: nagachika 488
* 4: svn 449
* 5: ko1 423
* 6: naruse 339
* 7: zzak 290
* 8: usa 276
* 9: kazu 149
* 10: drbrain 114
@kakutani
kakutani / commit-count-_total-rk14.md
Last active August 29, 2015 14:02
Ruby Commit Count for RubyKaigi 2014

Ruby Commit Count Since v2_0_0_0

...until the latest release on each branche (trunk, ruby_2_0, ruby_1_9_3)

  *  1: nobu        1870 # 100% discount(free as free-beer)
  *  2: akr          716 # |
  *  3: nagachika    488 # |
  *  4: svn          449 # |
  *  5: ko1          423 # |
  *  6: naruse       339 # |
@arika
arika / rails_erb_syntax_check.rb
Last active December 18, 2020 10:16
Rails(Action View) ERB template syntax checker
require 'action_view'
require 'ruby-beautify'
require 'ripper'
require 'tmpdir'
require 'fileutils'
require 'optparse'
def check_syntax(path, options = {})
erb = content(path)
code = ruby_code(erb)