Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🏴‍☠️

aycabta aycabta

💭
🏴‍☠️
  • Space Pirates, LLC.
View GitHub Profile
View RubyKaigi2021_daihon.md

RubyKaigi 2021

Hello, everyone. My name is Itoyanagi. I'm a climber, in particular, I do a lot of sawanobori. It is said that "the best way to enjoy the mountains is Sawanobori," so I wade through rapids in the wilderness, climb waterfalls, sometimes procure food locally, sleep by the fire, and head for the headwaters.

I was supposed to give a technical presentation on the riverside, as I always do in my online presentations, but I couldn't make it at all. So, I just spliced together some random footage from some mountains, and overlaid a technical explanation on top of it.

First of all, let me explain what the schedule was like this time. When I was accepted to RubyKaigi, I hadn't implemented any of the accepted features. This is a rough technique called "Kaigi Driven Development" that Ruby committers often use to make progress by taking advantage of the fact that they will have to implement the content to present it. The deadline for submitting videos for this year's English presentation was August 31s

@aycabta
aycabta / _README.md
Last active Mar 31, 2018
RDoc with frozen_string_literal
View _README.md

RDoc with frozen_string_literal

# use Ruby 2.4.3
$ ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]

# source code of Ruby 2.4.3
$ find . -maxdepth 1 -name "ruby-2.4.3"
./ruby-2.4.3
View my_remover.rb
# Reads unified diff file of CRuby documents between "before" and "after"
# from standard input and removes fixed line number changes
class MyRemover
def initialize
@lines = STDIN.readlines
@pos = 0
puts read_file_sections.flatten.join
end
View doctest.sh
#!/bin/bash
if [ $# -ne 1 ]; then
echo 'Usage: ./doctest.sh username/repository'
exit -1
fi
GITHUB_REPOSITORY_PATH=$1
GITHUB_USERNAME=`echo $GITHUB_REPOSITORY_PATH | sed -e 's/\/.\+$//'`
if [ ! -d original-rdoc ]; then
View Makefile
all: freebsd_pwm
freebsd_pwm: freebsd_pwm.o
clang freebsd_pwm.o -o freebsd_pwm
freebsd_pwm.o: freebsd_pwm.c
clang -c freebsd_pwm.c
clean:
rm freebsd_pwm freebsd_pwm.o
View freebsd_led_blink.c
View Makefile
all: test
test: test.o
gcc bcm2835-1.50/src/bcm2835.o test.o -o test
test.o: test.c
gcc -c -Ibcm2835-1.50/src/ test.c
clean:
rm test test.o
View one_click.rb
require 'mechanize'
EMAIL = ''
PASSWORD = ''
agent = Mechanize.new
agent.user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36'
puts 'log in try...'
page = agent.get('https://www.amazon.co.jp/')
signin_path = page.search('script').map(&:text).select { |t| t.include?('nav-flyout-ya-signin') }.first.gsub(/^.+nav-flyout-ya-signin[^>]+><a href='([^']+)'.+$/m, '\1')
View dymo.rb
require 'libusb'
VENDOR_ID = 0x0922
PRODUCT_ID = 0x8003
SCALING_FACTOR = 0.1
usb_context = LIBUSB::Context.new
device = usb_context.devices(idVendor: VENDOR_ID, idProduct: PRODUCT_ID).first
unless device
puts 'Device not found'
View gemoji_test.rb
require 'open-uri'
require 'json'
open('https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json') do |f|
json = JSON.parse(f.read)
puts json.size # => 1338
end