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
| :: StoryTitle | |
| Untitled Story | |
| :: StoryData | |
| { | |
| "ifid": "60E6E4FF-3324-4605-AB97-AB2421AE42BC", | |
| "format": "Harlowe", | |
| "format-version": "3.3.9", | |
| "start": "开始", |
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
| /* | |
| cc % -lncurses -O2 -o /tmp/vt && /tmp/vt | |
| */ | |
| #include <ncurses.h> | |
| #include <pty.h> | |
| #include <unistd.h> | |
| #include <sys/select.h> | |
| #include <sys/wait.h> | |
| #include <signal.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
| from krita import * | |
| def rename_layers_by_index(): | |
| doc = Krita.instance().activeDocument() | |
| if not doc: | |
| print('No active document') | |
| return | |
| def traverse(i, is_root, node): | |
| for child in node.childNodes(): |
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
| // cc buf-stdin.c -o buf-stdin -Wall -O2 | |
| #define _GNU_SOURCE | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <sys/mman.h> // memfd_create | |
| #define bail_out(s) (perror(s), exit(1)) |
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
| /* | |
| C++ subroutines for reading bicycle speed & cadence (CSC) sensor through BLE onto a computer. | |
| This has been integrated into an Unreal Engine 5 project to implement movement through a spinning bike. | |
| - `csc_start()`: Global initialisation. This only needs to be called once throughout execution. Automatically discovers devices, connects, and reconnects. Internally threaded. | |
| - `csc_get_movement(float dt)`: Gets movement for a given amount of delta time (`dt`, in seconds). | |
| Reference / further reading: | |
| https://learn.adafruit.com/bluetooth-bicycle-speed-cadence-sensor-display-with-clue |
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
| # for c in {a..z}; do echo $c; curl https://www.mso.anu.edu.au/~ralph/OPTED/v003/wb1913_$c.html >> OPTED.html; done | |
| # cat OPTED.html | grep "<P>" | perl -pe 's/<P><B>(.+?)<\/B> \(<I>(.*?)<\/I>\) (.*)<\/P>/$1\t$2\t$3/g' > OPTED.txt | |
| cat OPTED.html | grep "<P>" | perl -pe 's/<P><B>([A-Z])(.*?)<\/B> \(<I>(.*?)n\.(.*)<\/I>\) (.*)<\/P>/\L$1$2/g' | grep -v "^<P>" | uniq > OPTED.txt |
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
| // nuget install Newtonsoft.Json | |
| // cp Newtonsoft.Json.13.0.3/lib/net40/Newtonsoft.Json.dll . | |
| // csc CircuitBuilder.cs -r:Newtonsoft.Json.dll && mono CircuitBuilder.exe | |
| using Newtonsoft.Json; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; |
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
| // Testrun: fsharpc 1.fs && mono 1.exe | |
| // Build: fsharpc --target:library 1.fs | |
| module Add | |
| let f(a: int)(b: int): int = | |
| a + b | |
| [<EntryPoint>] | |
| let main argv = | |
| let printGreeting name = |
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
| // cc % -O2 -I../kissfft-131.1.0 ../kissfft-131.1.0/libkissfft-float.a | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include "kiss_fftr.h" | |
| int main() | |
| { | |
| float x[100]; |
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
| #include <stdio.h> | |
| #include <string.h> | |
| const char *shifttable = "23456789ABCDEFGHKLMNPRSTWXYZ"; | |
| const char *convtable[] = { | |
| "BELKCFHDGA27SZT8M9W43N6XR5YP", | |
| "ABCDEFGHKLMNPRSTWXYZ23456789", | |
| "E8AF2B93D46K7H5CGYPNWZRTLXMS", | |
| "BK5C6HD2A7F43E89LZGYMNXRWPST", |
NewerOlder