Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# coding: utf-8
import click
import math
from functools import partial
from itertools import imap
from sys import stdout
def fib(n, as_float=False):
from functools import partial
def get_client_broken():
class Client(object):
def request(*args, **kwargs):
# ...
return True
# This fails to compile with"NameError: global name 'request' is not defined"
get, post, put, delete = map(lambda verb: partial(request, verb),
#!/usr/bin/env python
# coding: utf-8
"""
The power of numbers is never more evident than when we use them to speculate
on the time of our dying. Sometimes I bargain with myself. Would I be willing
to accept sixty-five, Genghis Khan's age on dying? Suleiman the Magnificent
made it to seventy-six. That sounds all right, especially the way I feel now,
but how will it sound when I'm seventy-three?
Don DeLillo, White Noise
@peterldowns
peterldowns / keybase.md
Created June 21, 2016 15:39
Keybase proof

Keybase proof

I hereby claim:

  • I am peterldowns on github.
  • I am peterldowns (https://keybase.io/peterldowns) on keybase.
  • I have a public key ASBOgThh7YFg9eOomzJsmLVpKdjVkBQR6rWKiCxqcC9eAAo

To claim this, I am signing this object:

CELO_VALIDATOR_GROUP_ADDRESS=a23049064ddc56b436bb95f6b1512c553ab61d22 CELO_VALIDATOR_ADDRESS=9a4b4f0469e5a871a27cc9451ce69a6cf769d757 CELO_GENESIS_VALIDATOR_SIGNER_ADDRESS=aa3b76b6618afe574b278da9b71af0e66aa6f646 CELO_GENESIS_VALIDATOR_SIGNER_BLS_PUBLIC_KEY=348aa54a71033d583a29d00e3dfb1f696633c6520bc71099fd26a228d1882f380ab86ef19b7efe544d47ba8aeddf770125075f6c15b82611a31e746668c1aa8af2355efe6e4cd297c0f570fce18ecc2f274bef5115a8d8ba9a18a6563e6c6181

{
"claims": [
{
"url": "http://138.197.234.92",
"timestamp": 1580933954,
"type": "ATTESTATION_SERVICE_URL"
},
{
"timestamp": 1580933959,
"type": "ACCOUNT",
{
"claims": [
{
"timestamp": 1580933800,
"type": "ACCOUNT",
"address": "0x9A4B4f0469E5A871A27cc9451cE69A6cF769d757"
}
],
"meta": {
"address": "0xa23049064DdC56b436BB95f6B1512C553AB61D22",
@peterldowns
peterldowns / Justfile
Last active March 29, 2024 15:48
Script to generate a Makefile wrapper for a Justfile, with examples.
# this setting will allow passing arguments through to tasks, see the docs here
# https://just.systems/man/en/chapter_24.html#positional-arguments
set positional-arguments
# print all available commands by default
default:
just --list
# run the test suite
test *args='./...':
@peterldowns
peterldowns / preview.zsh
Created March 30, 2023 15:01
script to run a command and preview the results using fzf
#!/usr/bin/env zsh
# Opens the FZF preview in full-screen mode, and re-runs a command with any
# given arguments while allowing paging.
#
# Arguments:
# $1 = command to preview.
#
# Example:
# preview nix-search
#
@peterldowns
peterldowns / lorri.sh
Created April 30, 2023 13:13
wsl2 service config for lorri daemon
#!/bin/bash
# Put this at /etc/init.d/lorri
# then you can do
#
# service lorri start
# service lorri status
# service lorri stop
# service lorri restart
#
# as a regular user