Skip to content

Instantly share code, notes, and snippets.

View simonsan's full-sized avatar
🦀
Let's listen to this cassette on my rusty tapedeck. Drops ICE.

simonsan

🦀
Let's listen to this cassette on my rusty tapedeck. Drops ICE.
View GitHub Profile
@simonsan
simonsan / typescript-crash.ts
Created December 26, 2021 20:36 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@simonsan
simonsan / zalgo.rs
Created December 17, 2021 14:22 — forked from Eolu/zalgo.rs
Rust code to create Zalgo text
use rand::{Rng, thread_rng};
const ZALGO_UP: [char; 50] =
[
'\u{030e}', /* ̎ */ '\u{0304}', /* ̄ */ '\u{0305}', /* ̅ */
'\u{033f}', /* ̿ */ '\u{0311}', /* ̑ */ '\u{0306}', /* ̆ */ '\u{0310}', /* ̐ */
'\u{0352}', /* ͒ */ '\u{0357}', /* ͗ */ '\u{0351}', /* ͑ */ '\u{0307}', /* ̇ */
'\u{0308}', /* ̈ */ '\u{030a}', /* ̊ */ '\u{0342}', /* ͂ */ '\u{0343}', /* ̓ */
'\u{0344}', /* ̈́ */ '\u{034a}', /* ͊ */ '\u{034b}', /* ͋ */ '\u{034c}', /* ͌ */
'\u{0303}', /* ̃ */ '\u{0302}', /* ̂ */ '\u{030c}', /* ̌ */ '\u{0350}', /* ͐ */
@simonsan
simonsan / main.rs
Created November 24, 2021 23:19 — forked from codesections/main.rs
Warp_proof_of_concept
use futures::{Async, Future, Poll};
use tokio::io::{AsyncRead, AsyncWrite, Error, ReadHalf, WriteHalf};
use tokio::net::TcpStream;
use warp::{path, Filter, Stream};
struct Receiver {
rx: ReadHalf<TcpStream>,
}
impl Stream for Receiver {
type Item = String;
@simonsan
simonsan / opcache.ini
Created November 4, 2021 16:46 — forked from rohankhudedev/opcache.ini
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512
@simonsan
simonsan / aoe2bot-readme.md
Last active April 23, 2021 09:20
Readme for AoE2Bot by polskafan

aoe2bot

This repository contains a web app/API for chatbots for Age of Empires II streams. The API is developed in Python, and is designed to run on a remote server. Bots can then query pages for game and player information in response to viewer-issued commands.

API Reference

@simonsan
simonsan / how-to-write-hygienic-macros.md
Created November 28, 2020 16:21 — forked from Kestrer/how-to-write-hygienic-macros.md
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@simonsan
simonsan / secrecy.rs
Created October 17, 2020 01:47 — forked from benma/secrecy.rs
use secrecy::{ExposeSecret, Secret};
#[derive(Debug)]
struct EncryptionKey(Secret<[u8; 32]>);
fn get_encryption_key() -> EncryptionKey {
let key = EncryptionKey(Secret::new(*b"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"));
println!("Pointer at creation: {:p}", key.0.expose_secret().as_ptr());
key
}
@simonsan
simonsan / python_boilerplate.py
Created September 4, 2020 05:09 — forked from ssokolow/python_boilerplate.py
The raw/initial output from "boiler" in my ~/.vim/snippets/python.snippets
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""[application description here]"""
# Prevent Python 2.x PyLint from complaining if run on this
from __future__ import (absolute_import, division, print_function,
with_statement, unicode_literals)
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__appname__ = "[application name here]"
@simonsan
simonsan / single-frame-output.patch
Last active April 17, 2020 22:54
Upscaling Information and Workflow
From 2c6dbb25bb8bbd57c8e14fe3e9f6abfbd09a6545 Mon Sep 17 00:00:00 2001
From: heinezen <[email protected]>
Date: Fri, 17 Apr 2020 04:07:07 +0200
Subject: [PATCH] output single frames
---
openage/convert/texture.py | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/openage/convert/texture.py b/openage/convert/texture.py
@simonsan
simonsan / settings_menu_entries.md
Last active April 13, 2019 20:01 — forked from heinezen/settings_menu_entries.md
Documentation about the possible menu entries in the OpenAge Settings.

Settings Menu Entries for OpenAge

Bold: Options from HD, UserPatch and Voobly

Italic: Options that will likely be in OpenAge

Normal: Nice-to-have features

General Game Settings