Skip to content

Instantly share code, notes, and snippets.

@yoshimov
yoshimov / slack-rain-notify.gs
Last active September 13, 2016 08:43
Notify tenki.jp weather to Slack using Google Apps Script
// GAS Script for weather daemon on Slack
// ScriptProperties:
// - weatherUrl: Local weather web page URL on tenki.jp
// - slackHookUrl: Slack web hook URL
// - slackChannel: Channel name of Slack
function rainRetrieve() {
var url = PropertiesService.getScriptProperties().getProperty("weatherUrl");
var res = UrlFetchApp.fetch(url);
@yoshimov
yoshimov / Powershell-batch.bat
Created February 15, 2016 08:11
Powershell batch
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof
# some powershell script
@yoshimov
yoshimov / pebble-bigdate.html
Last active October 2, 2015 09:09
config for v1.1
<html>
<head>
<link rel="stylesheet" href="https://rawgit.com/pebble/slate/master/dist/css/slate.min.css" />
</head>
<body>
<h1 class="title">BigDate configuration</h1>
<div class='item-container'>
<div class='item-container-content'>
<label class='item'>
@yoshimov
yoshimov / pebble-habitrpg.html
Created June 23, 2015 15:22
Configuration page for Pebble-HabitRPG
<html>
<body>
<h2>HabitRPG for Pebble configuration</h2>
<table>
<tr>
<th>Your UUID: </th><td><input type="text" id="uuid" name="uuid" size="60" /></td>
</tr>
<tr>
<th>API Key: </th>
<td><input type="text" id="key" name="key" size="60" /></td>
@yoshimov
yoshimov / gollum-multibyte.diff
Last active August 29, 2015 14:19
gollum-multibyte.diff for gollum 4.0.0
*** ./lib/gollum/helpers.rb.org Thu Feb 27 00:19:51 2014
--- ./lib/gollum/helpers.rb Thu Feb 27 00:20:35 2014
***************
*** 6,12 ****
return nil if file_path.nil?
last_slash = file_path.rindex("/")
if last_slash
! file_path[0, last_slash]
end
end
@yoshimov
yoshimov / ingress-comm.js
Last active August 27, 2020 10:00
Collect Ingress COMM log with PhantomJS
/* SETTINGS */
var l='';
var p='';
var area = 'https://www.ingress.com/intel?ll=35.5841133,139.4988137&z=14';
var v = 20000; //Delay between capturing screenshots, in milliseconds (1000 ms = 1 s)
var reloadtime = 60000 * 120;
var width = 900; //Picture width
var height = 500; //Picture height
var folder = './'; //Folder where to save screenshots, with / (or \) on the end. '.' means current folder.
phantom.injectJs('settings.js');
@yoshimov
yoshimov / get-lastupdate.sh
Created January 23, 2015 08:35
get the last updated date of sub folder.
git log -1 --pretty="%ci" . | cut -d ' ' -f 1 | tr -d '-'
@yoshimov
yoshimov / docker-startup.sh
Created November 17, 2014 02:59
Docker startup shell script for init
#!/bin/bash
set -e
### BEGIN INIT INFO
# Provides: docker-webdav
# Required-Start: $syslog $remote_fs docker
# Required-Stop: $syslog $remote_fs docker
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Keymap for Atom Emacs key bindings
'.workspace .editor':
'ctrl-h': 'core:backspace'
'ctrl-d': 'core:delete'
'ctrl-a': 'editor:move-to-first-character-of-line'
'ctrl-e': 'editor:move-to-end-of-screen-line'
'ctrl-k': 'editor:delete-line'
@yoshimov
yoshimov / Dockerfile
Created May 22, 2014 08:43
Dockerfile for jekyll build.
# Docker file for Jekyll build
FROM ubuntu:13.10
RUN apt-get update
RUN apt-get install -y ruby2.0 ruby2.0-dev build-essential screen
RUN gem install jekyll
RUN gem install therubyracer
VOLUME [ "/jekyll" ]