Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
{
echo '"' ;
date +%s ;
echo '",' ;
speedtest --progress=no --format=csv;
result=$?;
while (( $result ))
do
sleep 10
@Mekajiki
Mekajiki / google-cloud-vision-renderer.html
Last active March 1, 2020 16:12
Renderer for text annotation by Google Cloud Vision wrapping on an image
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bs-custom-file-input/dist/bs-custom-file-input.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid pt-3
HOge | fuga
----- | -----
hoge | fuga
#!/usr/bin/env ruby
seed = '三徳' +
'新' +
'禄介' +
'雄一朗' +
'崇'
name = seed.split('')
.select { rand > 0.8 }
.shuffle
@Mekajiki
Mekajiki / fix_itunes_rating.rb
Last active February 15, 2018 16:20
fix "iTunes Music Library.xml" which has album ratings for non-rated tracks
#!/usr/bin/env ruby
out = File.open('/tmp/iTunes Music Library.xml', 'w')
in_path = 'iTunes/iTunes Music Library.xml'
regex_rating = /<key>Album Rating<\/key><integer>\d+<\/integer>/
regex_rating_computed_true = /<key>Album Rating Computed<\/key><true\/>/
regex_rating_computed_false = /<key>Album Rating Computed<\/key><false\/>/
regex_last_line = /<\/plist>/
rate_computed = " <key>Album Rating Computed</key><true/>\n"
<?xml version="1.0"?>
<root>
<!-- ============================================================ -->
<!-- appdef for microsoft remote desktop -->
<appdef>
<appname>MSREMOTEDESKTOP</appname>
<equal>com.microsoft.rdc.mac</equal>
</appdef>
<item>
# Description:
# A way to retrieve shop information of ネオ屋台村
#
# Commands:
# hubot yatai - answer today's yatai-village menu
# hubot yatai <village name> - search village and list today's yatai-village menu
request = require 'request'
cheerio = require 'cheerio'
cron = require('cron').CronJob
body {
color: #666;
background-color: #eef;
}
h2 {
font-size: 20px;
}
h3 {
body {
color: #666;
background-color: #eef;
}
h2 {
font-size: 20px;
}
h3 {