Skip to content

Instantly share code, notes, and snippets.

View munky69rock's full-sized avatar
:octocat:
Colla(コラ) というサービスを開発してます

Masayuki Uehara munky69rock

:octocat:
Colla(コラ) というサービスを開発してます
View GitHub Profile
@munky69rock
munky69rock / enable-twitter-widget.patch
Created September 1, 2020 05:56
How to use Twitter widget with Fruition (https://fruitionsite.com/)
@@ -88,6 +88,12 @@ async function fetchAndApply(request) {
}
const notionUrl = 'https://www.notion.so' + url.pathname;
let response;
+
+ // Twitter Widget
+ if (url.pathname.startsWith('/twitter') && url.pathname.endsWith('js')) {
+ return fetch(notionUrl);
+ }
+
@munky69rock
munky69rock / bulk_rename_git_tags.sh
Last active May 21, 2019 07:01
Rename git tags
#!/bin/bash
tags=$(git tag)
prefix="prefix"
for tag in ${tags[@]}; do
git tag ${prefix}-${tag} ${tag}
git tag -d ${tag}
git push origin :${tag}
@munky69rock
munky69rock / notion_app_opener.js
Created April 25, 2019 05:17
Notion App Opener for Tampermonkey
// ==UserScript==
// @name Notion App Opener
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace Notion URL to open native app
// @author Masayuki Uehara
// @match https://*.notion.so/*
// @match https://notion.so/*
// @grant window.close
// ==/UserScript==
@munky69rock
munky69rock / download_all_hojin_bango_csv.rb
Last active May 24, 2022 04:25
法人番号公表サイトから都道府県別の全件データをまるっとダウンロードするスクリプト
# frozen_string_literal: true
require 'nokogiri'
require 'open-uri'
require 'http'
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0'
DOWNLOAD_INDEX_URL = 'http://www.houjin-bangou.nta.go.jp/download/zenken/'
DOWNLOAD_URL = 'http://www.houjin-bangou.nta.go.jp/download/zenken/index.html'
TOKEN_KEY = 'jp.go.nta.houjin_bangou.framework.web.common.CNSFWTokenProcessor.request.token'
@munky69rock
munky69rock / slack_notifier.py
Created September 1, 2018 05:55
Send notification to slack
#!/usr/bin/env python2
import argparse
import json
import sys
import urllib
import urllib2
'''
Example Usage:
@munky69rock
munky69rock / seach_and_download_slack_file.rb
Created August 9, 2018 09:01
Search and download slack files from cli
require 'date'
require 'json'
require 'net/https'
require 'optparse'
require 'uri'
# token: https://api.slack.com/custom-integrations/legacy-tokens
# Usage:
# ruby ./retrieve_slack_image.rb --token "YOUR_SLACK_TOKEN" --query "in:#random type:images (IMG OR Slack OR iOS)"
@munky69rock
munky69rock / send_heroku_deploy_notification_to_slack.js
Last active July 15, 2018 00:33
Lambda + API Gatewayを利用してherokuのDeploy HooksをSlackに通知する (要Lambda Proxy Integration)
const https = require('https');
const querystring = require('querystring');
const url = require('url');
const SLACK_URL = url.parse('__YOUR_SLACK_WEBHOOK_URL__');
const slackOptions = {
channel: '#heroku',
username: 'heroku',
icon_emoji: ':heroku:'
};
@munky69rock
munky69rock / show_amazon_wish_list_links.sh
Created June 25, 2018 15:59
アマゾンのウィッシュリストのURL一覧出すやつ (with Nokogiri)
@munky69rock
munky69rock / simple-process-watcher.sh
Created July 10, 2017 09:29
Simple Process Watcher
#!/bin/bash
set -ue
keyword="$1"
time=${2:-60}
while test -n "$(ps aufx | grep $keyword | grep -v grep | grep -v $0)"; do
sleep $time
done