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
| // $ mkdir braille | |
| // $ cd braille | |
| // $ go mod init braille | |
| // $ <... copy this file into main.go> | |
| // $ go build | |
| // $ curl -sf <some image> | ./braille -width 100 -height 100 -lum 128 | |
| package main | |
| import ( |
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/sh | |
| # xshot.sh | |
| # by sugo/vim | |
| usage() { | |
| echo Usage: $0 [-h] "[-select|-full|-edit|-upload]" | |
| } | |
| get_image() { |
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" | |
| "fmt" | |
| "sort" | |
| "sync" | |
| "runtime" | |
| "go/token" | |
| "go/parser" |
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
| #![feature(const_fn)] | |
| #![feature(const_raw_ptr_deref)] | |
| fn main() { | |
| const SIN_90: f32 = SINTAB[90]; | |
| println!("{}", SIN_90); | |
| } | |
| const fn to_radians(x: f64) -> f64 { | |
| x * (std::f64::consts::PI / 180.0) |
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
| macro_rules! switch { | |
| ($( $cond:expr => $result:expr ),+ $(,)?) => { | |
| match true { | |
| $( _ if $cond => $result ),+, | |
| _ => unreachable!(), | |
| } | |
| } | |
| } | |
| fn main() { |
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
| __command() -> usage(); | |
| usage() -> ( | |
| '/diamonds consult\n' + | |
| '/diamonds deposit <amount>\n' + | |
| '/diamonds withdraw <amount>\n' + | |
| '/diamonds sacrifice <amount>\n' + | |
| '/diamonds transfer <target-user> <amount>' | |
| ); |
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
| // This is targeting windows specifically, because I made this for my brother. | |
| // If you need to use this abomination yourself, be sure to edit the code accordingly. | |
| package main | |
| import ( | |
| "os" | |
| "log" | |
| "fmt" | |
| "sync" | |
| "bufio" |
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
| # Let us write some code to snoop up our firefox history database file... | |
| # This is when hoarding browser history links is actually useful! | |
| # Never nuke your browser history, kids! :^) | |
| import re | |
| import sqlite3 | |
| from contextlib import closing | |
| from sys import argv |
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" | |
| "encoding/gob" | |
| "compress/gzip" | |
| "fmt" | |
| "github.com/bwmarrin/discordgo" | |
| ) |
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
| use std::ffi::c_void; | |
| use std::os::raw::c_int; | |
| extern "C" { | |
| fn setjmp(env: *mut c_void) -> c_int; | |
| fn longjmp(env: *mut c_void, val: c_int); | |
| } | |
| const JMP_BUF_SIZ: usize = 512; |