Skip to content

Instantly share code, notes, and snippets.

View edwardkenfox's full-sized avatar
🎯
Focusing

Edward Fox edwardkenfox

🎯
Focusing
View GitHub Profile
sendBeacon attempt 0 with 0 bytes succeeded
...
sendBeacon attempt 362 with 65703 bytes succeeded
sendBeacon attempt 363 with 65703 bytes failed
@edwardkenfox
edwardkenfox / gh_copy_bookmarklet.js
Created May 15, 2018 22:26
Copy GitHub PR title and link in markdown format
javascript:(function(){ var title = document.querySelector('.js-issue-title').innerText; var prNum = document.querySelector('.gh-header-number').innerText; var link = location.href.split('#')[0]; var text = `${title} [${prNum}](${location.href.split('#')[0]})` ; var b=document.createElement("textarea"), c=document.getSelection(); b.textContent=text, document.body.appendChild(b), c.removeAllRanges(), b.select(), document.execCommand("copy"), c.removeAllRanges(), document.body.removeChild(b); }());
@edwardkenfox
edwardkenfox / lottery_2018.rb
Last active May 13, 2019 22:11
Google I/O お土産抽選
winners = []
entries = {
"tshirt-1" => ["yumiko", "kurokawa", "ykawamura", "sato", "naoki", "nakahira", "takehiroxy", "hyeji", "nakahama", "tenshotanaka", "kengoiwt", "joker1007", "yuji"],
"tshirt-2" => ["yumiko", "kurokawa", "ykawamura", "sato", "naoki", "nakahira", "takehiroxy", "hyeji", "nakahama", "tenshotanaka", "kengoiwt", "joker1007", "yuji"],
"bag" => ["yumiko", "kurokawa", "hiratama", "naoki", "AtsushiHanyu", "nakahira", "taison", "mizuho", "satsukiy"],
"sunglasses" => ["yumiko", "tsubasa_sasaki", "kurokawa", "naoki", "hyeji"],
"water bottle" => ["yumiko", "Kasumi Inoue", "ykawamura", "hiratama", "naoki", "hyeji", "kengoiwt", "senohirona"],
}
entries.each do |k, v|
@edwardkenfox
edwardkenfox / _user_info.html.erb
Last active March 21, 2018 16:01
Vue on rails sample
<div id="user_info">
</div>
<script>
javascript_tag do
<<-JS
window.User = window.User || #{@json_from_controller_or_wherever.html_safe};
JS
end
</script>
@edwardkenfox
edwardkenfox / count_trello_cards_in_list_with_specified_label.sh
Created March 18, 2018 06:17
Count trello cards in a list with specified label attached
curl 'https://api.trello.com/1/lists/${LIST_ID}/cards?key=${KEY}&token=${TOKEN}&fields=name,labels' | jq '.[].labels[].name | contains("Bug") | select(.)' | wc -l
@edwardkenfox
edwardkenfox / feed-index.html
Created November 5, 2017 00:58
Show GHJ feed
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h1>feed test</h1>
<ul id="list"></ul>
<script>
const url = "https://query.yahooapis.com/v1/public/yql?q=SELECT%20channel.item%20FROM%20feednormalizer%20WHERE%20output%3D%22rss_2.0%22%20AND%20url%20%3D%22https%3A%2F%2Fgrowthhackjournal.com%2Ffeed%2F%22%20LIMIT%202&format=json&diagnostics=false"
@edwardkenfox
edwardkenfox / index.html
Created September 12, 2017 12:36
Vue $refs order check
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app"></div>
<script>
@edwardkenfox
edwardkenfox / result.txt
Last active May 27, 2017 07:23
vue-child-props-default-is-never-used.html
parent created: msg of parent
child created: msg of parent
child ready: msg of parent
parent ready: msg of parent
@edwardkenfox
edwardkenfox / imgcat
Created March 15, 2017 12:15
imgcat clone
#!/bin/bash
# cloned from: https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat
# tmux & iTerm2 on the host is required
#
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ $TERM == screen* ]] ; then
@edwardkenfox
edwardkenfox / webrtc_test.html
Created January 1, 2017 04:22
webrtc_test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<video id="local_video" autoplay></video>
<video id="remote_video" autoplay></video>