Skip to content

Instantly share code, notes, and snippets.

Avatar
👷‍♂️
Building stuff

Ian Lewis ianlewis

👷‍♂️
Building stuff
View GitHub Profile
View Makefile
# $ make
# dep1
#
# $ make test-foo
# dep2
# test-foo
#
# $ make dep3
# dep2
# dep1
@ianlewis
ianlewis / sys_sum.go
Created May 25, 2019
Simple syscall in gVisor
View sys_sum.go
// 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,
View keybase.md

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:

View ingress-watwat.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kuard
labels:
app: kuard
spec:
rules:
- http:
paths:
@ianlewis
ianlewis / sleepbot_migrate.py
Created Nov 24, 2016
A Python script for migrating from SleepBot to Sleep for Android
View sleepbot_migrate.py
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 Dec 14, 2016
A conversion script for SleepBot CSV data. Merges multiple rows on for the same date.
View sleepbot_csv.py
#:coding=utf-8:
import sys
import csv
import collections
import decimal
import datetime
def main(csv_path, output_path):
@ianlewis
ianlewis / eijiro.py
Created Dec 24, 2014
A work in progress tool for converting Eijiro database into something more usable.
View eijiro.py
# 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 Mar 31, 2014
A drop-in replacement for rm that copies files to the Gnome trash rather than deleting them.
View rm.sh
#!/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 Aug 29, 2015
A script for recommending a reviewer for a diff.
View recommend_reviewer.sh
#!/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 Jan 24, 2014
Twitter Card/Open Graph support for Blogger ref: http://qiita.com/IanMLewis/items/375d5c1d19c164de340f
View file0.xml
<!-- 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;'>
You can’t perform that action at this time.