Skip to content

Instantly share code, notes, and snippets.

@tomprince
tomprince / default.nix
Created September 1, 2021 00:04
PEP517 requirements in mach-nix
{mach-nix, pkgs ? import <nixpkgs> {}, lib ? pkgs.lib}:
let
extract-metadata = import ./extract-metadata.nix { inherit lib mkPython pkgs; };
buildPythonApplication = {...}@args: let
metadata = extract-metadata { inherit (args) python src providers; };
requirements = lib.concatStringsSep "\n" metadata.requires_dist;
in
mach-nix.buildPythonApplication ({ inherit requirements; } // args);
in
buildPythonApplication { ... };
boardLayouts = {
{ -- 1 Board
["Balanced"] = {
{ pos = Vector(5.96, 1.08, 16.59), rot = Vector(0.00, 180.00, 0.00) },
},
["Thematic"] = {
{ pos = Vector(-1.93, 1.08, 20.44), rot = Vector(0.00, 180.00, 0.00), board = " NE" },
},
},
{ -- 2 Board
from mercurial import (
registrar,
revset,
)
revsetpredicate = registrar.revsetpredicate()
@revsetpredicate('fromfile()')
def revset_fromfile(repo, subset, x):
[ui]
username = Tom Prince <tom.prince@hocat.ca>
interface = curses
pagintate = true
statuscopies = true
rollback = false
ignore = ~/.config/hg/ignore
@tomprince
tomprince / changes.diff
Created November 16, 2017 22:03
Scope changes for Bug 1415619
> taskcluster-admin@1.0.0 tcadmin /home/tomprince/src/taskcluster/taskcluster-admin
> node lib/index.js "make-gecko-branch-role" "-n" "--all"
scope changes required for role repo:hg.mozilla.org/incubator/stylo:*:
- queue:route:index.docker.images.v1.stylo.*
- index:insert-task:docker.images.v1.stylo.*
+ index:route:index:gecko.cache.level-2.*
+ index:insert-task:gecko.cache.level-2.*
+ secrets:get:project/releng/gecko/build/level-2/*
@tomprince
tomprince / ssh_config
Created June 8, 2017 19:00
Config for using a bastion
Host rust-bastion
User tomprince
Hostname 54.215.17.149
Host cargobomb-test
User ec2-user
ProxyJump rust-bastion
Hostname 54.177.234.51
Host cargobomb-prod
diff --git a/src/twisted/internet/_sslverify.py b/src/twisted/internet/_sslverify.py
index b62ccc5..7535297 100644
--- a/src/twisted/internet/_sslverify.py
+++ b/src/twisted/internet/_sslverify.py
@@ -24,32 +24,27 @@ from twisted.python._oldstyle import _oldStyle
from ._idna import _idnaBytes
+import attr
def deco(f):
def wrapper(*args, **kwargs):
return ensureDeferred(f(*args, **kwargs))
return wrapper
from math import sqrt, ceil
def shell(n):
a = int(ceil(sqrt(n)))
if a % 2 == 0:
a += 1
c = a - 1
d = c / 2
return d
import pytest
@pytest.fixture(scope="session", autouse=True)
def cleandir(tmpdir_factory, request):
tmpdir = tmpdir_factory.mktemp('data')
tmpdir.chdir()