View main.go
package main | |
import ( | |
"errors" | |
"flag" | |
"fmt" | |
"os" | |
"path/filepath" | |
"strings" | |
"unicode" |
View main.go
package main | |
import ( | |
"flag" | |
"fmt" | |
"net" | |
"os" | |
) | |
func main() { |
View swift.yaml
name: Swift | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- ".github/workflows/swift.yaml" | |
- "**.swift" | |
- "**/Package.resolved" |
View dependabot-go-fixup.yaml
name: Dependabot Go modules | |
on: | |
pull_request: | |
paths: | |
- "go.mod" | |
- "go.sum" | |
jobs: | |
dependabot: |
View Makefile
TOOLS := swiftformat protoc-gen-swift protoc-gen-grpc-swift | |
tools: $(TOOLS) | |
$(TOOLS): Package.swift Package.resolved | |
swift build -c release --product $@ | |
cp $$(swift build -c release --show-bin-path)/$@ ~/bin/ |
View Makefile
# To make a sandwich: | |
# $ make <track> sandwich | |
# e.g.: make alpha sandwich | |
# | |
# This works by rewriting MAKECMDGOALS by stripping the argument from the list | |
# and recursively calling make with a variable assignment (e.g. track=alpha) | |
# and the remaining goal(s). | |
# | |
# The ifeq below ensures that the “real” goals aren’t executed unless the | |
# track variable is set. The @: command silences the “Nothing to be done” |
View record-in-48khz-via-airpods.swift
// Thanks https://amorten.com/blog/2017/ios-bluetooth-and-microphone-input/ | |
func configure() { | |
// ... | |
let session = AVAudioSession.sharedInstance() | |
let sampleRate = 48000.0 | |
do { |
View syncmap.go
package syncmap | |
import ( | |
"sync" | |
) | |
// Map wraps a sync.Map to enable idempotent deferred creation of new values. | |
type Map struct { | |
sync.Map | |
} |
View EXPIRENX.txt
DEL example.com | |
HSET example.com status reserved | |
EVAL "return redis.call('TTL',KEYS[1])>0 or redis.call('EXPIRE',KEYS[1],ARGV[1])" 1 example.com 111111 | |
HGETALL example.com | |
TTL example.com | |
HSET example.com comment IANA | |
EVAL "return redis.call('TTL',KEYS[1])>0 or redis.call('EXPIRE',KEYS[1],ARGV[1])" 1 example.com 222222 |
View .circleci-config.yml
version: 2 | |
jobs: | |
build: | |
working_directory: ~/app | |
docker: | |
- image: circleci/node:8.7-browsers | |
environment: | |
NODE_ENV: production | |
steps: | |
- checkout |
NewerOlder