Skip to content

Instantly share code, notes, and snippets.

View itspacrat's full-sized avatar
🦀
Learning more rust

Blake itspacrat

🦀
Learning more rust
View GitHub Profile
@ClarkeRemy
ClarkeRemy / formula.rs
Last active October 23, 2024 04:19
Compile Time Boolean formula Interpreter
use std::marker::PhantomData;
enum Ast{};
enum Eval{};
trait Mode {}
impl Mode for Ast {}
impl Mode for Eval {}
@ClarkeRemy
ClarkeRemy / tail_drop_elimination.rs
Last active February 10, 2024 19:14
Initial proposal for Tail-Drop Elimination
///! Proposal for guaranteed Tail-Drop elimination for functions that do not return values.
///!
///! We revisit the `become` keyword limiting it to functions that do not return values
///! Given this constraint, it becomes much easier to implement.
///! A programmer can always supply the place to return to with a continuation anyways quite trivialy.
/// This is why it must be done at a language level.
/// The programmer cannot do this themselves or they would have a stack overflow.
/// If the programmer did try to do it themselves, it would require a very complex, type unsafe way to do it.
/// All parts can be guaranteed to be sound statically
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active November 9, 2024 14:25
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",
@Bluscream
Bluscream / obs_twitch_chat.css
Last active October 4, 2024 07:05
Twitch chat transparent popout for OBS
/*
Twitch chat browsersource CSS for OBS
Original by twitch.tv/starvingpoet modified by github.com/Bluscream
Just set the URL as either one of
- https://www.twitch.tv/%%TWITCHCHANNEL%%/chat?popout=true
- https://www.twitch.tv/popout/%%TWITCHCHANNEL%%/chat
- https://www.twitch.tv/embed/%%TWITCHCHANNEL%%/chat?parent=localhost
And paste this entire file into the CSS box or paste direct import css like
@fluxrad
fluxrad / onedark.theme
Last active October 6, 2024 07:33
A one-dark theme for xfce4-terminal
[Scheme]
Name=One Dark
ColorForeground=#ABB2BF
ColorCursor=#ABB2BF
ColorBackground=#282C34
ColorSelection=#3B4451
ColorSelectionUseDefault=FALSE
ColorBold=#B9C0CB
ColorBoldUseDefault=FALSE
ColorPalette=#282C34;#E06C75;#98C379;#E5C07B;#61AFEF;#C678DD;#56B6C2;#ABB2BF;#3E4452;#BE5046;#98C379;#D19A66;#61AFEF;#C678DD;#56B6C2;#5C6370
@fser
fser / honey-passwd
Created May 12, 2017 12:17
Password dump between 02/09/17 and 05/10/17 on a public ssh honeypot
4564 123456
4315 password
3543 admin
2964 1234
2620 12345
2090 ubnt
2038 root
1802 111111
1392 000000
1346 support
@evanwill
evanwill / gitBash_windows.md
Last active October 24, 2024 17:27
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@Parmeisan
Parmeisan / Macro Parameters
Last active February 10, 2021 16:20
Roll20 - Macro Parameters
// Purpose: Allows you to automatically fill in macro variables, from chat or from another macro.
// Usage: #MacroName(param1,param2)
// Do NOT include a space after MacroName and before the (. If you do that, Roll20 intercepts it
// before sending it to the chat, and there's nothing I can do to help you. :)
var parm_macro_params = parm_macro_params || {};
// Interrupts all chat messages to check for macros.
on("chat:message", function(msg)