Skip to content

Instantly share code, notes, and snippets.

@osapon
osapon / localStorage.js
Last active February 1, 2016 14:11
localStorage.js
(function (lstorage) {
lstorage.set = function(name,val) {
while(true) {
var key_name = '', old_dt = Date.now();
try{
localStorage.setItem(name, window.JSON.stringify({
'data':val,
'dt':Date.now()
}));
}
put_slack() {
channel_id=`curl -s "https://slack.com/api/im.open" --data "token=${slack_team_key}" --data "user=${slack_user_id}" --data "pretty=1" | jq -r ".channel.id"`
curl -s 'https://slack.com/api/chat.postMessage' \
--data "token=${slack_team_key}" \
--data "channel=${channel_id}" \
--data "pretty=1" \
--data-urlencode "text=$1"
}

Keybase proof

I hereby claim:

  • I am osapon on github.
  • I am osapon (https://keybase.io/osapon) on keybase.
  • I have a public key whose fingerprint is 2306 990F FA7E 8235 804B 1924 3ADF B39C D4D1 BEAE

To claim this, I am signing this object:

@osapon
osapon / gist:2222cd8952190ad4c9694f6f0c9bbe38
Last active September 28, 2017 02:18
Bloggerで記事毎の共有ボタンに「Mastoshare」を並べるスクリプト。デザインによってクラスの調整は必要だと思う。
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$('.blog-posts > .date-outer').each(function(idx,obj) {
var title = $('.post-title',obj).text();
$('.post-share-buttons',obj).append('<a href="https://mastoshare.net/post.php?text=' + encodeURIComponent(title) + '" onclick="window.open(this.href, \'\', \'width=500,height=400\'); return false;"><img src="https://mastoshare.net/img/toot.svg" width="75" height="20"></a>');
});
});
</script>
@osapon
osapon / mastodon.user.css
Last active March 13, 2018 08:05
Mastodonの2.3.0とかで動くようにしているcss。トゥートの間隔を詰めて、unarist氏の固定トゥート圧縮をさらに改造
.drawer {
overflow : visible ;
width : 25% !important ;
height : 400px !important ;
}
.emoji-dialog {
z-index : 1 !important ;
position : fixed !important ;
@osapon
osapon / gist:2fd6ef8b7f5f1fee63357eda42a4daad
Created January 16, 2019 11:14
punycodeから第一水準漢字あたりを出した。
1342 xn--bbk ま
1349 xn--bbr 函
1350 xn--bbs 囆
1351 xn--bbt 宏
1352 xn--bbu 恘
1353 xn--bbv 攡
1354 xn--bbw 槪
1355 xn--bbx 溳
1356 xn--bby 獼
1357 xn--bbz 硅
console.log("%cストップ!", "color: #88F; font-size: 400%; font-weight:bold;text-shadow: rgb(0, 0, 0) 3px 0px 0px, rgb(0, 0, 0) 2.83333px 0.983333px 0px, rgb(0, 0, 0) 2.35px 1.85px 0px, rgb(0, 0, 0) 1.61667px 2.51667px 0px, rgb(0, 0, 0) 0.7px 2.91667px 0px, rgb(0, 0, 0) -0.283333px 2.98333px 0px, rgb(0, 0, 0) -1.25px 2.73333px 0px, rgb(0, 0, 0) -2.06667px 2.16667px 0px, rgb(0, 0, 0) -2.66667px 1.36667px 0px, rgb(0, 0, 0) -2.96667px 0.416667px 0px, rgb(0, 0, 0) -2.95px -0.566667px 0px, rgb(0, 0, 0) -2.6px -1.5px 0px, rgb(0, 0, 0) -1.96667px -2.26667px 0px, rgb(0, 0, 0) -1.11667px -2.78333px 0px, rgb(0, 0, 0) -0.133333px -3px 0px, rgb(0, 0, 0) 0.85px -2.88333px 0px, rgb(0, 0, 0) 1.75px -2.43333px 0px, rgb(0, 0, 0) 2.45px -1.73333px 0px, rgb(0, 0, 0) 2.88333px -0.833333px 0px;");
console.log("もし誰かにここにコピペしろと言われたなら、あなたは11割騙されています。");
console.log("%cここに何かを貼り付けたら悪意のあるユーザーにあなたのアカウントを乗っ取られるかもしれません。", "color: red; font-weight:bold;");
@osapon
osapon / netlify.toml
Last active January 27, 2020 03:42
netlify 503 page setting
[[redirects]]
from = "/*"
to = "/mente.html"
status = 503
force = true
@osapon
osapon / a.md
Last active October 24, 2020 08:15
自治体役所同士の近い順(区役所含む)

SELECT

距離(m)
0 相模原市役所 中央区中央2-11-15 map 相模原市中央区役所 中央2-11-15 map
0 堺市役所 堺区南瓦町3-1 map 堺市堺区役所 南瓦町3-1 map
0 浜松市役所 中区元城町103-2 map 浜松市中区役所 元城町103-2 map
0 新潟市役所 中央区学校町通1番町602-1 map 新潟市中央区役所 学校町通1番町602-1 map
0 岡山市役所 北区大供一丁目1-1 map 岡山市北区役所 大供一丁目1-1 map
51 さいたま市役所 浦和区常盤6-4-4 [map](https://www.google.