↓
This file contains hidden or 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 { extname } from 'node:path' | |
| import sharp, { FormatEnum } from 'sharp' | |
| import type { Plugin } from 'vite' | |
| function sharpPlugin(): Plugin { | |
| return { | |
| name: 'vite:sharp', | |
| enforce: 'post', | |
| apply: 'build', | |
| async generateBundle(_, bundle) { |
This file contains hidden or 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 | |
| args=( | |
| minimal=yes # build only gpsd | |
| gpsdclients=no # without clients | |
| gpsd_group=uucp # arch linux group | |
| socket_export=yes # fixes gps_unpack | |
| control_socket=yes # for /run/gpsd.sock | |
| ) |
This file contains hidden or 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
| /* | |
| An example that converts os.Args to argc/argv for C. | |
| Can be used with any []string with the same procedure. | |
| */ | |
| package main | |
| /* | |
| #include <stdio.h> | |
| #include <stdlib.h> |
This file contains hidden or 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 ( | |
| "encoding/binary" | |
| "fmt" | |
| "net" | |
| "time" | |
| ) | |
| type Packet struct { |
GPSD for GeoClue2 using NMEA over TCP.
- Copy the XML file to
/etc/avahi/services/nmea-0183.service. - Run
glue.pyin order to start the service (listens on10110/tcp). - Optionally create a service (systemd or the like) for it to start at boot.
- Optionally disable all GeoClue2 sources except
network-nmeato use GPS only.
This file contains hidden or 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
| // Simple Golang script for controlling Wiz light bulbs. | |
| // It uses UDP discovery and makes it blink randomly. | |
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "log" |
This file contains hidden or 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
| // Log custom tags used by running go root, and the files where they | |
| // are used, so you can quickly see which tags can be used for | |
| // specific behavior or just see, for example, which modules are CGo. | |
| package main | |
| import ( | |
| "fmt" | |
| "go/scanner" | |
| "go/token" |
This file contains hidden or 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
| PLATFORMS := windows/386 windows/amd64 linux/386 linux/amd64 linux/arm linux/arm64 | |
| export CGO_ENABLED = 0 | |
| export GO386 = softfloat | |
| parts = $(subst /, ,$@) | |
| export GOOS = $(word 1,$(parts)) | |
| export GOARCH = $(word 2,$(parts)) | |
| export EXT = $(if $(filter windows,$(GOOS)),exe,bin) |
This file contains hidden or 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" | |
| "strconv" | |
| "syscall" | |
| "unsafe" | |
| ) | |
| var mm []uint32 |