Skip to content

Instantly share code, notes, and snippets.

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 13:47
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@gettalong
gettalong / README.md
Last active May 21, 2024 13:47
Performance comparison of simple text rendering between Python reportlab, Ruby Prawn and HexaPDF

The Python PDF generation library reportlab contains a demo/benchmarking application that takes the Project Gutenberg text of Homer's Odyssey and creates a PDF version from it. This text contains 10.437 lines and about 611.000 characters.

The PDF is generated by simply showing each line of the source text, without wrapping or any other advanced text facilities, once using the built-in standard PDF fonts and once using a TrueType font, creating PDF documents with 232 pages.

This is a nice test of raw text output performance and, as noted above, doesn't need any advanced text layout facilities.

In addition to reportlab I have ported the code to Ruby's Prawn, Perl's PDF::API2 and PHP's TCPDF libraries, to have a broader comparison. Note that reportlab has a module implemented in C that replaces various CPU intensive methods. There is an extra entry for that version of reportlab.

The file script.sh is a small wrapper script that calls the binaries and records runtime, memory use and the size of the created

@gitaarik
gitaarik / git_submodules.md
Last active May 21, 2024 13:46
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active May 21, 2024 13:46
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 21, 2024 13:45
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@carstenwindler
carstenwindler / xdebug.sh
Last active May 21, 2024 13:44
Bash script to quickly enable / disable xdebug in a PHP docker container
#!/usr/bin/env bash
# see https://carstenwindler.de/php/enable-xdebug-on-demand-in-your-local-docker-environment/
if [ "$#" -ne 1 ]; then
SCRIPT_PATH=`basename "$0"`
echo "Usage: $SCRIPT_PATH enable|disable"
exit 1;
fi
# Expects service to be called app in docker-compose.yml
@mehdihasan
mehdihasan / install-oc-client-ubuntu.md
Last active May 21, 2024 13:44
Install OC client in Ubuntu/Debian
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created February 9, 2021 19:58
Code from the YouTube video on History pushState and replaceState
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>History push and replace state</title>
<link rel="stylesheet" href="./main.css" />
</head>
<body>
#!/bin/bash
# Get the start of today in the correct format
start_of_today=$(date -v0H -v0M -v0S +"%Y-%m-%dT%H:%M:%S")
# Initialize counters
files_changed=0
insertions=0
deletions=0