This file contains 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 sys | |
import os | |
# Add the _vendor directory to the Python path | |
vendor_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_vendor') | |
sys.path.insert(0, vendor_dir) | |
# Now you can import the bundled library | |
import openai |
This file contains 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
exprs = File.readlines('input') | |
.map { |l| " (seq.unit \"#{l.chomp}\")" } | |
.join("\n") | |
smt2 = File.read('tpl.smt2') | |
.sub('%EXPRS%', exprs) | |
File.write('out.smt2', smt2) | |
This file contains 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
(set-logic QF_ALIA) | |
(declare-const len Int) | |
(assert (= len 247)) | |
(declare-const a (Array Int Int)) | |
(define-fun x () (Array Int Int) | |
(store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store |
This file contains 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
(set-logic AUFLIA) | |
(declare-sort RPS 0) | |
(declare-fun rock () RPS) | |
(declare-fun paper () RPS) | |
(declare-fun scissors () RPS) | |
(declare-sort OUTCOME 0) | |
(declare-fun win () OUTCOME) | |
(declare-fun lose () OUTCOME) |
This file contains 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
// -*- mode: c++ -*- | |
#include "Kaleidoscope.h" | |
#include "Kaleidoscope-Macros.h" | |
#include "Kaleidoscope-LEDControl.h" | |
#include "Kaleidoscope-LEDEffect-BootGreeting.h" | |
#include "Kaleidoscope-LED-Stalker.h" | |
#include "Kaleidoscope-SpaceCadet.h" | |
// Macros |
This file contains 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
// -*- mode: c++ -*- | |
#include "Kaleidoscope.h" | |
#include "Kaleidoscope-Macros.h" | |
#include "Kaleidoscope-LEDControl.h" | |
#include "Kaleidoscope-LEDEffect-BootGreeting.h" | |
#include "Kaleidoscope-LED-Stalker.h" | |
#include "Kaleidoscope-SpaceCadet.h" | |
// Macros |
This file contains 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/ruby --disable-gems | |
require('open3') | |
# http://fsck.com/~jesse/tmp/2019-02-15/bdfca368-6f85-40d3-ba47-e730c4c2b712/left-key-spacing.pdf | |
out, stat = Open3.capture2('qpdf', '--qdf', '--object-streams=disable', 'left-key-spacing.pdf', '-') | |
abort('qpdf fail') unless stat.success? | |
out.force_encoding(Encoding::BINARY) | |
# coordinates are indexed from top-left, x is horizontal; y is vertical |
This file contains 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
#!/bin/bash | |
set -euo pipefail | |
plists=() | |
while read -r pl; do | |
plists+=("${pl}") | |
done < <(ls ~/Library/LaunchAgents) | |
len=${#plists[@]} | |
height=$((len + 2)) |
This file contains 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 ruby | |
require('open3') | |
extra_fswatch_args, cmd_args = if (rest_index = ARGV.index('--')) | |
[ARGV[0...rest_index], ARGV[rest_index+1..-1]] | |
else | |
[[], ARGV] | |
end |
This file contains 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
# fragment added to ~/.zshrc | |
zle-gasdf() { gasdf; zle .beginning-of-line; zle .kill-line; zle .accept-line } | |
zle -N zle-gasdf | |
bindkey 'å' zle-gasdf # Alt-A Canadian English |