Skip to content

Instantly share code, notes, and snippets.

View sielicki's full-sized avatar

Nicholas Sielicki sielicki

  • Annapurna Labs
  • Cupertino, CA
View GitHub Profile
@sielicki
sielicki / flake.lock
Last active February 18, 2024 23:39
nix derivation show /nix/store/6csgn4mqc2r1rkp4grmzp5sgz7ciyp12-std-0.32.0-dev-go-modules.drv https://github.com/divnix/std/issues/372
{
"nodes": {
"attic": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-utils": [
"flake-utils"
],
"nixpkgs": "nixpkgs",
import collections
def lazy_categorize(iterable, predicate):
a, b = collections.deque(), collections.deque()
empty = False
def _gen_generator(t=True):
d = a if t else b
d_inv = b if t else a
#!/usr/bin/env python3
import z3
import pprint
# 9x9 matrix of integer variables
X = [ [ z3.Int("x_%s_%s" % (i+1, j+1)) for j in range(9) ]
for i in range(9) ]
# each cell contains a value in {1, ..., 9}
cells_c = [ z3.And(1 <= X[i][j], X[i][j] <= 9)
import typing as t
### Data Types
# Little Endian LSB MSB
row_in = t.Tuple[bool, bool, bool, bool]
# Also little endian
mat_in = t.Tuple[
row_in,
row_in,
row_in,
@sielicki
sielicki / booleanfunction.js
Created October 2, 2018 16:27
Table of a boolean function`
results = [["X", "Y", "Z", "F"]];
Array.from({ length: 8 }, (_, k) => k).map(x => x.toString(2)
.padStart(3, 0))
.map(x => x.split(""))
.map(x => x.map(y => Boolean(parseInt(y))))
.map(x => function(a,b,c) {
results.push([a,b,c,
(
// Put your own F here
{"last_check":"2018-06-08T00:22:24Z","pypi_version":"10.0.1"}
function on_mouse_click(name, value)
local screenW, screenH = mp.get_osd_size()
local mouseX, mouseY = mp.get_mouse_pos()
local adb = "adb shell input tap %s %s &"
os.execute(string.format(adb, mouseX, mouseY))
-- mp.msg.info(string.format(adb, mouseX, mouseY))
end
mp.add_key_binding("MBTN_LEFT", "something", on_mouse_click)
// ==UserScript==
// @name gamepadify
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://*.jukejuice.com:*
// @include http://*.newcompte.*
// @author sielicki
// ==/UserScript==
var s = [false,false,false,false];

Keybase proof

I hereby claim:

  • I am sielicki on github.
  • I am nls (https://keybase.io/nls) on keybase.
  • I have a public key ASC5KsgXpQn5qi9fxqbieeXjyQUrmzViwFYAhxZMLCDqSAo

To claim this, I am signing this object:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Websocket Scale</title>
<style>