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 python3 | |
import ephem | |
from datetime import datetime, timedelta, timezone | |
# don't generate any invocations until | |
SKIP_UNTIL = datetime(2021, 10, 16, 12, 0, 0) | |
# times to run per day | |
FOODS = 8 | |
# thing to run |
This file has been truncated, but you can view the full file.
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
0.22188506458333335 0 | |
0.22195119791666668 504 | |
0.22201742291666668 511 | |
0.22208362291666667 510 | |
0.22214973125 511 | |
0.22221593958333333 0 | |
0.22228210625 511 | |
0.22234823958333333 511 | |
0.22241446875 504 | |
0.22248198125 511 |
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
# I had a fancy custom type in PG, and wanted to use it in | |
# SQLAlchemy. I didn't care to jump through all of the custom | |
# type stuff, and the type had an reasonable representation | |
# to JSON, and PG could convert it to/from JSON very easily. | |
# So I added cast conversions to PG, and then this special | |
# type: | |
class CastToJSONB(sqlalchemy.types.TypeDecorator): | |
'''A JSON object where we force PostgreSQL to cast our | |
interactions with the value to JSON. Useful when we've | |
got a PG data type that is a pain in the ass, but has an |
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
\version "2.18.2" | |
\language "english" | |
right = \relative c'' { | |
\key c \major | |
\numericTimeSignature | |
\time 4/4 | |
\tempo "Whatever" 4=60 | |
% ... | |
} |
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
age record.layer.demo; | |
import com.apple.foundationdb.record.metadata.expressions.FunctionKeyExpression; | |
import com.apple.foundationdb.record.metadata.expressions.QueryableKeyExpression; | |
import com.apple.foundationdb.record.metadata.expressions.KeyExpression; | |
import com.apple.foundationdb.annotation.API; | |
import com.apple.foundationdb.record.metadata.Key; | |
import com.apple.foundationdb.record.metadata.MetaDataException; | |
import com.apple.foundationdb.record.provider.foundationdb.FDBRecord; | |
import com.google.protobuf.Message; |
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
#lang racket/base | |
(require racket/tcp racket/async-channel racket/match racket/function) | |
(define-struct ami [input-port | |
output-port thread | |
request-channel | |
response-channel | |
event-channel | |
[dead? #:mutable]] |
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/python | |
################# | |
# NOTE | |
# Now at https://github.com/jkominek/updatestars | |
################# | |
import requests | |
import json | |
import re |
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 java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.HashMap; | |
public class KellysFavorite implements Player { | |
private ArrayList<Double> cache = new ArrayList<Double>(); |
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
#lang racket | |
; idea: use inspectors & parameters to protect values so they | |
; can't be used outside of approved dynamic extents. | |
; probably not fully baked? (continuations, etc) | |
; (define-values (b lock) (locked-box important-v key)) | |
; (parameterize ([lock key]) | |
; ; in here b can be used | |
; (less-trusted-code b)) |
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
#lang racket/base | |
(require racket/cmdline) | |
(define-syntax-rule | |
(while<> line body ...) | |
(let ([process-port | |
(lambda () | |
(for ([line (in-port read-line)]) | |
body ...))]) |
NewerOlder