Skip to content

Instantly share code, notes, and snippets.

View wjt's full-sized avatar

Will Thompson wjt

View GitHub Profile
'''TIL: pyflakes and flake8 disagree on a common question of indentation.'''
def add(left,
right,
):
'''flake8 doesn't like this style:
duellinglinters.py:6:8: E124 closing bracket does not match visual indentation
'''
return left + right
gelf ~/src/bustle
% stack build
[1 of 2] Compiling Main ( /home/wjt/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /home/wjt/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /home/wjt/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /home/wjt/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /home/wjt/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 ...
mtl-2.2.1: configure
mtl-2.2.1: build
cereal-0.5.4.0: download
Cabal-1.24.2.0: download
network-2.6.3.1: download
#!/usr/bin/env python3
import bs4
import json
import logging
import os
import requests
log = logging.getLogger(__name__)
@wjt
wjt / 1f58194-f99c744.patch
Created May 12, 2017 15:35
Changes between 1f58194 and f99c744
--- /tmp/1f58194.patch 2017-05-12 16:34:01.562433899 +0100
+++ /tmp/f99c744.patch 2017-05-12 16:34:16.494562569 +0100
@@ -1,8 +1,8 @@
-commit 1f581944a41ac439d604124a67e969e6a19b0412
+commit f99c744b3e90891e58328740e24f41dcecf6c472
Author: Will Thompson <wjt@endlessm.com>
AuthorDate: Thu Apr 13 14:35:59 2017 +0100
Commit: Will Thompson <wjt@endlessm.com>
-CommitDate: Fri Apr 14 12:04:11 2017 +0100
+CommitDate: Thu May 11 14:43:42 2017 +0100
{
"app-id": "org.freedesktop.Bustle",
"runtime": "org.gnome.Platform",
"runtime-version": "3.24",
"sdk": "org.gnome.Sdk",
"command": "bustle",
"finish-args": [
"--socket=x11",
"--socket=wayland",
"--socket=system-bus",
@wjt
wjt / gist:a94b0daa8ca2b31976aca4b5c8c81743
Last active August 1, 2017 17:52
Endless Notebooks
dummy file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
from gi.repository import Gio
resolver = Gio.Resolver.get_default()
name = 'sdk.gnome.org'
print('Looking up', name)
addresses = resolver.lookup_by_name(name)
print('Results:')
for a in addresses:
print(a.get_family().value_nick, a.to_string(), a)
print('--------')
#!/bin/bash -ex
f() {
local x=$(echo oh no; false)
echo "f: $x"
}
g() {
local y
y=$(echo oh no; false)
echo "g: $y"
}
diff --git a/Makefile.am b/Makefile.am
index cd10f5b..d5b3636 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,10 +9,14 @@ SUBDIRS = \
po \
data \
eos-installer-data \
- tests
+ tests \