Skip to content

Instantly share code, notes, and snippets.

View CoolOppo's full-sized avatar
🇺🇲

Max Azoury CoolOppo

🇺🇲
View GitHub Profile
@CoolOppo
CoolOppo / Cargo.toml
Last active September 15, 2024 10:55
How to compile to a DLL in rust while using it as a normal rust library
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <[email protected]>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@CoolOppo
CoolOppo / CompileAndMinify.ps1
Created December 3, 2018 20:54
Fast, parallel, web build script. Written by me in PowerShell.
workflow compileAndMinify {
$jsFiles = Get-ChildItem -Recurse -Include *.js -Exclude *.min.js
parallel {
sequence {
$scssFiles = Get-ChildItem -Recurse -Include *.scss
ForEach -Parallel ($file in $scssFiles) {
$dir = (Get-Item $file).Directory.FullName
$cmd = ("sass """ + $($file.FullName) + """ """ + $dir + "\" + $file.BaseName + ".css""")
Invoke-Expression $cmd
}
@CoolOppo
CoolOppo / .clang-format
Last active August 20, 2018 13:26
My clang-format style
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
@athiyadeviyani
athiyadeviyani / tkinterlist.py
Created July 19, 2018 08:27
Python GUI cheatsheet
# BASIC TKINTER CHEATSHEET
# Build basic GUIs with Python
from tkinter import *
from tkinter import scrolledtext
from tkinter import messagebox
from tkinter.ttk import Progressbar
from tkinter import filedialog
from tkinter import Menu
@mustelida
mustelida / Hexpatcher.md
Last active January 19, 2025 08:12
Batch apply hex edits in PowerShell
@realmonster
realmonster / CRT3.cg
Last active July 8, 2019 23:45
NOT Ideal NTSC composite cable CRT simulation for RetroArch
// NOT Ideal NTSC composite cable CRT simulation for RetroArch <- fix of title.
// by r57shell
// thanks to feos & HardWareMan
// ideal in terms of ideal encoding/decoding,
// also, without any passbands.
// also TV subpixels and scanlines
void main_vertex
(
@jdarpinian
jdarpinian / executable.c
Last active April 2, 2025 15:41
Add one line to your C/C++ source to make it executable.
///$(which true);FLAGS="-g -Wall -Wextra --std=c17 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $FLAGS "$THIS_FILE" -o "$OUT_FILE" || exit $?;exec bash -c "exec -a \"$0\" \"$OUT_FILE\" $([ $# -eq 0 ] || printf ' "%s"' "$@")"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
@patricknelson
patricknelson / Quaternion.shader
Last active April 13, 2025 11:21 — forked from nkint/pointTowards.vertex
Shader functions to facilitate rotation of vertex around point with a quaternion (Unity / HLSL / Cg)
// Full shader example demonstrating how to use a quaterionion to rotate a vertex around a specific point. Note that this is just a plain
// vanilla unlit shader which includes the necessary functions (see section below) and example code in the vertex shader.
//
// Forked from https://gist.github.com/nkint/7449c893fb7d6b5fa83118b8474d7dcb
// Converted from GLSL to Cg. For help with that, see https://alastaira.wordpress.com/2015/08/07/unity-shadertoys-a-k-a-converting-glsl-shaders-to-cghlsl/
//
// quaternion code from https://github.com/stackgl/gl-quat
// rotation from https://twistedpairdevelopment.wordpress.com/2013/02/11/rotating-a-vector-by-a-quaternion-in-glsl/
Shader "Unlit/Quaternion"
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active June 9, 2025 00:02
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@fongandrew
fongandrew / react-bind.md
Last active January 14, 2024 16:02
Explaining why we bind things in React

Start With This

Before getting to React, it's helpful to know what this does generally in Javascript. Take the following snippet of code. It's written in ES6 but the principles for this predate ES6.

class Dog {
  constructor() {