Skip to content

Instantly share code, notes, and snippets.

my dear son

Toshimaru toshimaru

my dear son
Block or report user

Report or block toshimaru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
  • level-1
    • level-3
    • level-2
    • level-2
      • level-3

* level-3
  • level-2
View heredoc1.rb
def a
doc = <<-EOS
def hello
puts "Hello World!"
View arrow_def.rb
require 'benchmark/ips'
Benchmark.ips do |x|
ary = [] {
10_000.times do |num|
ary << "#{num} #{num * 2} #{num * 3}"

Try webpacker

Try rails/webpacker


gem 'webpacker', github: "rails/webpacker"
toshimaru /
Last active Sep 8, 2019
How to connect to server via SSH and use remote-exec provisioner.
resource "digitalocean_droplet" "web" {
image = "ubuntu-16-04-x64"
name = "web-1"
region = "sgp1"
size = "512mb"
ssh_keys = [12345]
connection {
type = "ssh"
user = "root"
toshimaru /
Last active May 3, 2018 — forked from kimh/
Install MySQL 5.7 non-interactively in CircleCI
set -x
set -e
export DEBIAN_FRONTEND=noninteractive
curl -LO
echo mysql-apt-config mysql-apt-config/select-product select Apply | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-connector-python select none | sudo debconf-set-selections
View read-data-attribute.html
<title>data-attribute test</title>
<script src=""></script>
<div id="tgt" data-msg='my message is here!'>

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.


toshimaru / jquery-scroll-bottom.js
Last active Nov 13, 2019
Detect the scrolling to bottom of the page using jQuery.
View jquery-scroll-bottom.js
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
toshimaru / scroll-to-element.js
Created Jul 12, 2013
Scroll to the particular element using jQuery.
View scroll-to-element.js
$('.info').on('click', function(){
$('html, body').animate({
scrollTop: $(this).offset().top
}, 500);
You can’t perform that action at this time.