Skip to content

Instantly share code, notes, and snippets.

View weskerfoot's full-sized avatar

Wesley Kerfoot weskerfoot

View GitHub Profile
require 'forwardable'
Foo = Struct.new(:x) do
def bar
x
end
end
class Bar
extend Forwardable
from itertools import zip_longest
def convert(st):
pairs = zip_longest(st, st[1:])
for c, n in pairs:
if c == "e" and n != "e":
yield "va"
elif c == "e" and n == "e":
yield c
yield c
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
use std::io;
use std::fmt;
#[derive(Clone, Debug, PartialEq)]
enum RPNValue<'a> {
Op(&'a str),
Val(i32)
}
impl fmt::Display for RPNValue<'_> {
nodemcu-tool reset
esptool.py erase_flash
esptool.py --port /dev/ttyUSB0 write_flash -fm qio 0x00000 nodemcu-release-18-modules-2021-07-11-23-06-19-float.bin
nodemcu-tool upload *.lua
while [[ $? != 0 ]]; do
nodemcu-tool upload *.lua
done
echo 'dofile("init.lua")' | nodemcu-tool terminal
#! /usr/bin/env python3
from ecdsa import VerifyingKey
from binascii import hexlify
from sys import argv, stdout
with open(argv[1], "rb") as cert:
cert_contents = cert.read()
stdout.write(hexlify(VerifyingKey.from_pem(cert_contents).to_string(encoding="uncompressed")).decode("ascii") + "\n")
import x11/xlib, x11/x, x11/xinput
import options
#
# PXDeviceInfo* = ptr TXDeviceInfo
# TXDeviceInfo* {.final.} = object
# id*: TXID
# `type`*: TAtom
# name*: cstring
# num_classes*: cint
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson
data Name = Name {
firstName :: String,
lastName :: String
} deriving (Show, Eq)
instance FromJSON Name where
parseJSON = withObject "Name" $ \v -> Name
Maybe<bool> Message::Serialize(Environment* env,
Local<Context> context,
Local<Value> input,
const TransferList& transfer_list_v,
Local<Object> source_port) {
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(context);
// Verify that we're not silently overwriting an existing message.
URxvt.perl-ext-common: default,tabbed
URxvt.geometry: 190x60
URxvt.depth: 32
URxvt.background: rgba:0000/0000/0000/cccc
URxvt.foreground:white
urxvt*depth: 32
URxvt.font: xft:DejaVu Sans Mono:pixelsize=14,xft:Code 2000:pixelsize=15
dzen2.font: -*-fixed-*-*-*-*-*-*-*-*-*-*-*-*