Skip to content

Instantly share code, notes, and snippets.

View curlpipe's full-sized avatar
💻
Translating my brain into a machine learning model (36% complete)

Luke curlpipe

💻
Translating my brain into a machine learning model (36% complete)
  • United Kingdom
View GitHub Profile
@curlpipe
curlpipe / counter.nim
Created June 22, 2020 18:59
My first proper nim project
# Import things
import sequtils
import strutils
import regex
import os
# Read data from file
var data = paramStr(1).readFile.toLowerAscii
# Remove the parts of the file we don't want to count
@curlpipe
curlpipe / speeds.md
Created March 3, 2021 23:25
Language speed tiers

Tier 1: 0ms to 9ms

  • C++ (Compiled to native)
  • C (Compiled to native)
  • Rust (Compiled to native)

Tier 2: 10ms to 14ms

  • Crystal (Compiled to native)
  • V (Transpiled to C)
  • Dart (Compiled to native)
  • Javascript (Interpreted)
@curlpipe
curlpipe / handy.md
Created March 20, 2021 20:36
List of handy crates for Rust

A list of handy Rust crates

Here is a list of crates that will make your code and general Rust experience more readable and clean, because Rust can get pretty ugly sometimes.

I encourage you to check through each item in this list to determine if it is of some use to you.

Cargo

cargo-bloat

https://lib.rs/crates/cargo-bloat

@curlpipe
curlpipe / pratt.rs
Created March 31, 2021 22:09
A simple pratt parser in Rust
// A simple pratt parser in Rust
use std::fmt;
// Tree enum, for representing trees
pub enum Tree {
// This holds a number e.g. `3`
Number(usize),
// This holds an operation e.g. `1 + 2`
Operation(Box<Tree>, char, Box<Tree>),
}
@curlpipe
curlpipe / rat.rs
Created May 15, 2021 10:18
Rat - Display files on the terminal
// Rat - Cat but it's in Rust
use pico_args::{Arguments, Error};
use std::fs;
// Help message
const HELP: &str = "\
rat - A program to read and display files
Usage:
rat [options] FILE
Options:
@curlpipe
curlpipe / stackbunch_example.html
Created August 24, 2021 23:27
The stackbunch library example
<html lang="en">
<head>
<meta charset="UTF-8">
<script defer src="stackbunch.js"></script>
</head>
<body mobile="500px" tablet="700px" desktop="1000px">
<stack>
<bunch class="titlebar">
<div class="logo">
@curlpipe
curlpipe / csshock.css
Last active September 2, 2024 16:44
An ultra lightweight css framework
/*
CSShock v0.2: rapid styling for your web interfaces
*/
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');
:root {
/* Colors */
--text-color: #E0E0E0;
--background-color: #1A1A2E;