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 / 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 nickski15@gmail.com (Nick Mihailovski)
* @author ianmlewis@gmail.com (Ian Lewis)
*/
@ianlewis
ianlewis / sys_sum.go
Created May 25, 2019 16:42
Simple syscall in gVisor
// Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
# $ make
# dep1
#
# $ make test-foo
# dep2
# test-foo
#
# $ make dep3
# dep2
# dep1
@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:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kuard
labels:
app: kuard
spec:
rules:
- http:
paths:
@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 / 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)
@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;'>