Skip to content

Instantly share code, notes, and snippets.

View ianlewis's full-sized avatar
👷‍♂️
Building stuff

Ian Lewis ianlewis

👷‍♂️
Building stuff
View GitHub Profile
@ianlewis
ianlewis / rest2html.py
Last active December 14, 2016 00:31
Redmine restructured text formatter.
u"""
sudo pip install docutils pygments # システム Python に docutils インストール
rvm use 1.8.7
gem install RbST
/var/www/vhosts/redmine/script/plugin install git://github.com/alphabetum/redmine_restructuredtext_formatter.git
RbST はなんと! 日本語に対応しません! orz (幸いなことに、 docutils の部分は Python で書かれている)
@ianlewis
ianlewis / csv_import_magic.js
Last active February 3, 2023 13:16
A Google Apps Script for importing CSV data into a Google Spreadsheet.
// vim: ft=javascript:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */
/*
* A script to automate requesting data from an external url that outputs CSV data.
*
* Adapted from the Google Analytics Report Automation (magic) script.
* @author [email protected] (Nick Mihailovski)
* @author [email protected] (Ian Lewis)
*/
@ianlewis
ianlewis / file0.xml
Created January 24, 2014 08:55
Twitter Card/Open Graph support for Blogger ref: http://qiita.com/IanMLewis/items/375d5c1d19c164de340f
<!-- Begin Open Graph metadata -->
<meta content='summary' name='twitter:card'/>
<meta content='@<your twitter account>' name='twitter:site'/>
<b:if cond='data:blog.metaDescription'>
<meta expr:content='data:blog.metaDescription' name='og:description'/>
<b:else/>
<!-- Twitter Cards require a description but blogger posts don't always have one -->
<meta content='<Default Post Description>' name='og:description'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
@ianlewis
ianlewis / recommend_reviewer.sh
Last active August 29, 2015 13:57
A script for recommending a reviewer for a diff.
#!/bin/bash
# A script for recommending a reviewer for a particular diff.
# Currently only supports mercurial repositories.
if [ "$1" = "" ]; then
echo "Usage: recommend_reviewer REV1 REV2"
exit 0
fi
@ianlewis
ianlewis / rm.sh
Created March 31, 2014 01:31
A drop-in replacement for rm that copies files to the Gnome trash rather than deleting them.
#!/bin/bash
# A drop-in replacement for rm that copies files to the Gnome trash rather than
# deleting them.
# Doesn't quite support all of the rm options yet.
readonly progname="$(basename $0)"
function printHelpAndExit {
exitCode=$1
@ianlewis
ianlewis / eijiro.py
Created December 24, 2014 15:01
A work in progress tool for converting Eijiro database into something more usable.
# A tool for converting Eijiro database into something more usable.
# A work in progress.
import sys
import MeCab
from lxml import etree
from multiprocessing import Process, Pipe
@ianlewis
ianlewis / sleepbot_csv.py
Last active December 14, 2016 00:31
A conversion script for SleepBot CSV data. Merges multiple rows on for the same date.
#:coding=utf-8:
import sys
import csv
import collections
import decimal
import datetime
def main(csv_path, output_path):
@ianlewis
ianlewis / sleepbot_migrate.py
Created November 24, 2016 06:39
A Python script for migrating from SleepBot to Sleep for Android
import csv
import sys
import calendar
import time
from datetime import datetime
# /storage/emulated/0/sleep-data/sleep-export.csv
# Formates Date/Time objects in Sleep as Android format
def sleepandroid_time(time):
return '%.2d. %.2d. %d %d:%.2d' % (time.day, time.month, time.year, time.hour, time.minute)
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kuard
labels:
app: kuard
spec:
rules:
- http:
paths:
@ianlewis
ianlewis / keybase.md
Created October 8, 2018 05:24
Keybase proof

Keybase proof

I hereby claim:

  • I am ianlewis on github.
  • I am ianlewis (https://keybase.io/ianlewis) on keybase.
  • I have a public key whose fingerprint is 1530 3166 31BB FFB6 E279 2984 0B2F C40B 81B9 E26C

To claim this, I am signing this object: