Skip to content

Instantly share code, notes, and snippets.

@CobaltXII
CobaltXII / cross_compiling_sdl2.md
Last active May 7, 2024 15:20
Cross-Compiling SDL2 Programs for Windows from Linux

Cross-Compiling SDL2 Programs for Windows from Linux

I'll explain how to create programs that run on Windows (.exe files) from a Linux machine. I'll explain how to compile C and C++, and how to make 32- and 64-bit programs. I'll also explain how to use third-party libraries (we'll use SDL2 here), and how to distribute the programs.

Installing and Using a Cross-Compiler

To cross-compile for another architecture, you first need to know what architecture you're compiling for. The important part here is the target triplet. It's typically in this format:

@thomaswilburn
thomaswilburn / pigeon.js
Last active May 7, 2024 15:19
Convert CSS to nested CSS
import { parse } from "https://deno.land/x/css@0.3.0/mod.ts";
var file = Deno.args[0];
var input = await Deno.readTextFile(file);
var parsed = parse(input, { value: true });
var root = {
rules: [],
@nimasrn
nimasrn / docker-compose.yml
Created November 15, 2021 17:53
redis replica with docker-compose
version: '3'
services:
redis:
image: redis:5.0.0
container_name: master
ports:
- "6379:6379"
networks:
- redis-replication
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active May 7, 2024 15:15
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

import network
import socket
import time
import struct
from machine import Pin
NTP_DELTA = 2208988800
host = "pool.ntp.org"
@DomPizzie
DomPizzie / README-Template.md
Last active May 7, 2024 15:11
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

@sebmarkbage
sebmarkbage / The Rules.md
Last active May 7, 2024 15:01
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@jgcastro89
jgcastro89 / GEPP
Created October 17, 2017 17:16
Gaussian Elimination with Partial Pivoting Modularized
import numpy as np
class GEPP():
"""
Gaussian elimination with partial pivoting.
input: A is an n x n numpy matrix
b is an n x 1 numpy array
output: x is the solution of Ax=b