Skip to content

Instantly share code, notes, and snippets.

View oieioi's full-sized avatar
🐙
🐙🐙🐙🐙🐙🐙🐙🐙🐙

oieioi

🐙
🐙🐙🐙🐙🐙🐙🐙🐙🐙
View GitHub Profile
@oieioi
oieioi / showmeta.user.js
Created January 25, 2021 03:27 — forked from SyunWatanabe/showmeta.js
show meta
// ==UserScript==
// @name show meta
// @namespace http://tampermonkey.net/
// @version 0.1
// @description show meta what we want
// @author me
// @match *://*/*
// @grant none
// ==/UserScript==
@oieioi
oieioi / lambda_function.rb
Last active September 1, 2020 03:31
Notify Slack of your daily AWS costs and usage using Lambda
require 'aws-sdk'
require 'net/http'
require 'uri'
require 'json'
# エントリーポイント
# See https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/lambda-ruby.html
def lambda_handler(event:, context:)
fetch_cost
.then { |res| pretty_response(res) }
@oieioi
oieioi / countDOMSizeEachDepth.js
Last active December 4, 2020 15:39
WebページのDOMの大きさを body からの深さごとに数えるスクリプトだよ
// 最初
// 'body *'
// d=1
// 'body > *:nth-child(1) *'
// 'body > *:nth-child(2) *'
// 'body > *:nth-child(3) *'
// 'body > *:nth-child(4) *'
// d=2
// 'body > *:nth-child(1) > *:nth-child(1) *'
// 'body > *:nth-child(1) > *:nth-child(2) *'
class Klass
def initialize
puts 'klass'
end
end
class Klass2
def initialize
puts 'klass 2'
end
@oieioi
oieioi / add-pull-requests-to-github-user-page.user.js
Last active October 11, 2023 03:14
Add pull requests to GitHub User page
// ==UserScript==
// @name add-pull-requests-link-to-github-user-page
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Add pull requests to GitHub User page
// @author oieioi
// @match https://github.com/*
// @grant none
// ==/UserScript==
@oieioi
oieioi / obj.js
Last active May 11, 2020 08:35
JSのthisとarrowの説明資料
var user = { name: 'john' }
console.log(user)
user.hello = function () {
// この this == user(レシーバー) になってほしい
return "I am " + this.name + "!"
}
user.callback = function (cb) {
console.log('exec callback')
def meth(arg, **kwargs)
puts "kwargs: #{kwargs}"
end
puts '---- no warning ----'
meth(1, hoge: 1) #=> no warning
meth(1, **{ hoge: 1 }) #=> no warning
public_send(:meth, *[1, **{hoge: 1}]) # => NO warning
puts '---- warning ----'
def meth(arg, **kwargs)
puts "kwargs: #{kwargs}"
end
puts '---- no warning ----'
meth(1, hoge: 1) #=> no warning
meth(1, **{ hoge: 1 }) #=> no warning
send(:meth, *[1, **{hoge: 1}]) # => NO warning
puts '---- warning ----'
@oieioi
oieioi / move-bookmeter-kansou-and-pie-chart-to-the-bottom.user.js
Last active May 4, 2020 03:55
読書メーターのユーザページのグラフと感想を下の方にする
// ==UserScript==
// @name Move bookmeter kansou and pie chart to the bottom
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 読書メーターのユーザページのグラフと感想を下の方にする
// @author oieioi
// @match https://bookmeter.com/*
// @grant none
// ==/UserScript==
<!DOCTYPE html>
<html lang="ja">
<head>
<title>Test</title>
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
<select id="list">
<option class="item" value="1">1</option>
<option class="item" value="2">2</option>