Skip to content

Instantly share code, notes, and snippets.

00:00:00.000 [INFO] [sway/main.c:346] Sway version 1.5-e5913f81 (Apr 24 2021, branch 'HEAD')
00:00:00.003 [INFO] [sway/main.c:154] Linux splurge 5.11.15-300.fc34.x86_64 #1 SMP Fri Apr 16 13:41:48 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
00:00:00.003 [INFO] [sway/main.c:170] Contents of /etc/os-release:
00:00:00.003 [INFO] [sway/main.c:154] NAME=Fedora
00:00:00.003 [INFO] [sway/main.c:154] VERSION="34 (Workstation Edition)"
00:00:00.003 [INFO] [sway/main.c:154] ID=fedora
00:00:00.003 [INFO] [sway/main.c:154] VERSION_ID=34
00:00:00.003 [INFO] [sway/main.c:154] VERSION_CODENAME=""
00:00:00.003 [INFO] [sway/main.c:154] PLATFORM_ID="platform:f34"
00:00:00.003 [INFO] [sway/main.c:154] PRETTY_NAME="Fedora 34 (Workstation Edition)"

Keybase proof

I hereby claim:

  • I am keis on github.
  • I am keis (https://keybase.io/keis) on keybase.
  • I have a public key whose fingerprint is EB07 7310 9172 6FEF 40FC 70D0 5210 E90D 5F80 FC88

To claim this, I am signing this object:

@keis
keis / error-matcher.js
Created March 31, 2015 17:00
error matcher
var hamjest = require('hamjest')
, util = require('util')
, _ = require('lodash')
module.exports = error
function IsError(type, message) {
var prop = hamjest.hasProperty('message', message)
return _.create(new hamjest.TypeSafeMatcher(),
function capture(regex) {
return function (req, res, next, val, name) {
var capture;
console.log("name", name, "val", val);
if (capture = regex.exec(val)) {
req.params[name] = capture;
next();
} else {
@keis
keis / gist:ab22f0c8729720119025
Created November 25, 2014 15:00
dulwich find commit
#!/usr/bin/env python2
from dulwich.repo import Repo
from collections import defaultdict, deque
def changes_file(key):
def matches(commit, entry):
changes = entry.changes()
@keis
keis / gist:13e5753fc98a01d9acbc
Created August 20, 2014 13:03
or maybe monster regexp?
matcher = re.compile(r'''^
(?:(?P<prefix>\[.*\])\s+)?
(?P<name>.+?)
([._ ](?P<year>[0-9]{4}))?
([. ]
(?:(
[Ss](?P<season>[0-9]+)
(
[Ee](?P<episode>[0-9]+)
)?
@keis
keis / coro.py
Created April 14, 2014 08:27
asyncio examples
import asyncio
@asyncio.coroutine
def waiting(r):
print("hello from waiting -", r)
yield from asyncio.sleep(2)
print("bye from waiting -", r)
return r
@keis
keis / logreport.js
Created December 4, 2013 11:47
extend mocha dot reporter with log4js capture
var log4js = require('log4js'),
Base = require('mocha/lib/reporters/base'),
Dot = require('mocha/lib/reporters/dot'),
diff = require('diff'),
ms = require('mocha/lib/ms'),
color = Base.color;
function LogReport(runner) {
var captured = [],
layout = log4js.layouts.colouredLayout;
var fs = require('fs'),
esprima = require('esprima'),
escodegen = require('escodegen'),
uglify = require('uglifyjs'),
_ = require('underscore');
function findScope(tree, key) {
var q = [],
scope,
node;
@keis
keis / loopback.js
Created October 7, 2013 12:42
loopback glue for log4js
var log4js = require('log4js'),
sentinel = {};
function loopbackAppender() {
return function (loggingEvent) {
var logger = log4js.getLogger(loggingEvent.categoryName),
isRemote = !!loggingEvent.remoteAddress,
hasLooped = loggingEvent._loopback !== sentinel;
if (hasLooped && isRemote) {