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
# $ make
# dep1
#
# $ make test-foo
# dep2
# test-foo
#
# $ make dep3
# dep2
# dep1
@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,
@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 / 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 / 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 / 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 / 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 / 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 / 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;'>