Skip to content

Instantly share code, notes, and snippets.

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

ggtmtmgg ggtmtmgg

🏠
Working from home
View GitHub Profile

どのようにすれば、20時間でネイティブの発音を理解してゆっくりなら完全に発音出来る状態になり、英文を読めば読むほど正しく口の筋肉が鍛えられる状態になるか。

更新 2019-03-10
バージョン 0.1.4
一言 いえい

なんとなく思ってることを雑に書き出してみる

  • 発音記号重要そう
@ggtmtmgg
ggtmtmgg / randstrings.rb
Last active October 14, 2017 11:37
outputs random strings of various lengths
### Usage
# download or copy this file to your unix computer
# open terminal
# $ cd <path to the directory which has randostrings.rb>
# $ ruby randstrings.rb
require 'securerandom'
length = 16
4.times do
puts "a random string which is #{length} chars length"

やりたいこと

admin/articles/1/editのページにて<li><a onClick={this._onMenuContentClick(1)}>見出し</a></li>(article_menu.jsx)をクリックをするたびに ContentsEditor.state.contentsに要素を追加しそれを更新・出力する。

現象

<li><a onClick={this._onMenuContentClick(1)}>見出し</a></li>で指定している_onMenuContentClick(1)がまだクリックされていないのにページ読み込み時に実行される ↓ ContentsEditor.onMenuClick(content)が無限回呼び出される ↓ 以下のエラーを吐く

require 'uri'
require 'net/http'
require 'optparse'
##################
# READHERE
##################
# 使い方:
# % ruby url_testing_tools_sample.rb --api=<YOUR API KEY> --url=<URL>
# Google API Manager(https://console.developers.google.com)で
require 'nokogiri'
require 'open-uri'
URL = 'https://www.youtube.com'
PLAYLIST_URL = URL + '<Playlist Path>'
puts = 'Scraping..'
doc = Nokogiri::HTML(open(PLAYLIST_URL))
videos_xpath = '//*[@id="pl-load-more-destination"]/tr'
@ggtmtmgg
ggtmtmgg / lyrics.rb
Last active January 3, 2017 03:03
Print lyrics on your terminal.
# lyrics.rb
# Usage: ruby lyrics.rb maroon5 maps
require 'json'
require 'open-uri'
artist = ARGV[0]
title = ARGV[1]
api_url = 'http://lyric-api.herokuapp.com/api/find/%s/%s'
source_url = URI.escape(api_url % [artist, title])