Skip to content

Instantly share code, notes, and snippets.

View nakabonne's full-sized avatar
👋

Ryo Nakao nakabonne

👋
View GitHub Profile
func getSERPsURLs(baseURL *url.URL, depth int) (pages []*url.URL, err error) {
doc, err := getDoc(baseURL)
i := 0
doc.Find("#nav").Each(func(_ int, table *goquery.Selection) {
table.Find("tbody").Each(func(_ int, trs *goquery.Selection) {
trs.Find("tr").Each(func(_ int, tds *goquery.Selection) {
tds.Find("td").Each(func(_ int, srg *goquery.Selection) {
srg.Find("a").Each(func(_ int, s *goquery.Selection) {
if i >= depth-1 {
return
package main
import (
"flag"
"fmt"
"time"
"github.com/marcusolsson/tui-go"
)
@nakabonne
nakabonne / reverse_polishn_notation.rb
Created July 17, 2017 08:51
逆ポーランド記法をrubyで実装
x = gets.chomp.split(' ')
s = []
x.each do |n|
case n
when '+'
one = s.pop
two = s.pop
s.push(one+two)
when '-'
one = s.pop
git clone https://github.com/grpc/grpc.git