Skip to content

Instantly share code, notes, and snippets.

vec2 rotate(vec2 v, float a) {
float s = sin(a);
float c = cos(a);
mat2 m = mat2(c, s, -s, c);
return m * v;
}
@subfuzion
subfuzion / curl.md
Last active July 25, 2024 08:53
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

prefix_raw = "\
dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
sivtagpadsaldivdactansidfabtarmonranniswolmispal\
lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
@jansegre
jansegre / script.lua
Last active February 10, 2020 23:48
Very basic luajit from Rust.
-- script.lua
-- Receives a table, returns the sum of its components.
io.write("The table the script received has:\n");
x = 0
for i = 1, #foo do
print(i, foo[i])
x = x + foo[i]
end
io.write("Returning data back to C\n");
return x
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active July 28, 2024 05:15
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@msmuenchen
msmuenchen / gist:9318327
Last active September 18, 2022 21:53
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@opatut
opatut / love-android-package
Created February 18, 2014 21:31
Android Löve2D debugging helper
#!/bin/bash
GAME=$1
DIR="/sdcard/love"
MIME="application/x-love-game"
INTENT="org.love2d.android/.GameActivity"
if [[ -z "$1" ]]; then
GAME="game.love"
echo "Creating game package at $GAME"
@wandernauta
wandernauta / sp
Last active July 10, 2024 07:57
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
diff -r dd56a497bb3b server/server.h
--- a/server/server.h Tue Sep 04 07:31:03 2012 +0000
+++ b/server/server.h Tue Oct 02 10:24:55 2012 +0000
@@ -271,6 +271,9 @@
//ugly hack for variable FPS support dropping s.event
int entity_events[MAX_EDICTS];
+
+ usercmd_t cmdHist[2];
+ int snaps;
/*
* Reviewing ray-tracing basics in glsl. Loosely based on Inigo Quilez's articles.
* Éric Renaud-Houde - num3ric.com
* December 2012
*/
#ifdef GL_ES
precision highp float;
#endif