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
Location: Location.m Location.info.plist | |
cc $< \ | |
-framework CoreLocation \ | |
-framework AppKit \ | |
-sectcreate __TEXT __info_plist Location.info.plist \ | |
-o $@ | |
[ "$$CODESIGN_IDENTITY" ] && \ | |
codesign \ | |
-s "${CODESIGN_IDENTITY}" \ | |
--verbose --force \ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist | |
PUBLIC '-//Apple//DTD PLIST 1.0//EN' | |
'http://www.apple.com/DTDs/PropertyList-1.0.dtd'> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleExecutable</key> | |
<string>Location</string> | |
<key>CFBundleIdentifier</key> | |
<string>com.example.location</string> |
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
// Exmaple of using CoreLocation on macOS. | |
// | |
// Link with: | |
// -framework AppKit | |
// -framework CoreLocation | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <AppKit/AppKit.h> | |
#include <CoreLocation/CoreLocation.h> | |
@interface Delegate : NSObject <CLLocationManagerDelegate> |
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
all: test build | |
COMMANDS = $(notdir $(wildcard cmd/*)) | |
BINARIES = $(addprefix build/,$(COMMANDS)) | |
${BINARIES}: $(shell find . -name '*.go') go.mod go.sum | |
@mkdir -p build | |
go get ./... | |
go build -o build ./... |
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
package main | |
import ( | |
"os" | |
) | |
import ( | |
"io" | |
"log/slog" | |
"path/filepath" |
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
package main | |
import ( | |
"fmt" | |
"google.golang.org/protobuf/proto" | |
// type proto.Message interface { .... | |
// func proto.Merge(dst, src Message) | |
"[...]/foo" | |
// syntax = "proto3"; | |
// message Foo { |
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
get_boolean_value_from_json() { | |
# Return true if the JSON file exists, the variable is set, and it | |
# evaluates as true in javascript. | |
test -f "$1" && osascript -l 'JavaScript' 2>&1 <<- EOF | |
ObjC.import('stdlib'); | |
$.exit(JSON.parse(\`$(cat "$1")\`).${2} ? 0 : 1); | |
EOF | |
} |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"strings" | |
) | |
func MuttSendFile(dstEmail, filePath string) error { |
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
package main | |
import ( | |
"exec" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func ConvertToEbook(src, dst, title, authors, comments string) error { |
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
package main | |
import ( | |
"regexp" | |
"sort" | |
"strings" | |
"golang.org/x/net/html" | |
) |
NewerOlder