This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'forwardable' | |
Foo = Struct.new(:x) do | |
def bar | |
x | |
end | |
end | |
class Bar | |
extend Forwardable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################# | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
use std::fmt; | |
#[derive(Clone, Debug, PartialEq)] | |
enum RPNValue<'a> { | |
Op(&'a str), | |
Val(i32) | |
} | |
impl fmt::Display for RPNValue<'_> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import x11/xlib, x11/x, x11/xinput | |
import options | |
# | |
# PXDeviceInfo* = ptr TXDeviceInfo | |
# TXDeviceInfo* {.final.} = object | |
# id*: TXID | |
# `type`*: TAtom | |
# name*: cstring | |
# num_classes*: cint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Aeson | |
data Name = Name { | |
firstName :: String, | |
lastName :: String | |
} deriving (Show, Eq) | |
instance FromJSON Name where | |
parseJSON = withObject "Name" $ \v -> Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-*-*-*-*-*-*-*-*-*-*-*-* |