Skip to content

Instantly share code, notes, and snippets.

View SupinePandora43's full-sized avatar
©️
#

SupinePandora43 SupinePandora43

©️
#
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@jonlabelle
jonlabelle / television_resolution_standards.md
Last active October 5, 2024 10:02
Digital and analog television standards resolution reference.

Television Standards

Digital and analog television standards resolution reference.

Digital TV Standards

Standard Resolution (dots × lines) DAR (H:V) Pixels
PixelVision 120 × 90 4:3 10,800
@cdiener
cdiener / asciinator.py
Last active January 5, 2023 17:24
Convert image to ascii art
import sys; from PIL import Image; import numpy as np
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
if len(sys.argv) != 4: print( 'Usage: ./asciinator.py image scale factor' ); sys.exit()
f, SC, GCF, WCF = sys.argv[1], float(sys.argv[2]), float(sys.argv[3]), 7/4
img = Image.open(f)
S = ( round(img.size[0]*SC*WCF), round(img.size[1]*SC) )
img = np.sum( np.asarray( img.resize(S) ), axis=2)
@unitycoder
unitycoder / PackTest.cs
Created May 22, 2015 17:00
Pack 3-Floats [0-1] to 1-Float
using UnityEngine;
using System.Collections;
// source: http://diaryofagraphicsprogrammer.blogspot.fi/2009/10/bitmasks-packing-data-into-fp-render.html
public class PackTest : MonoBehaviour {
void Start () {
@DaZombieKiller
DaZombieKiller / deepcopy.lua
Last active March 19, 2022 12:03 — forked from Deco/deepcopy.lua
Lua Non-recursive Deep-copy
--[[ deepcopy.lua
Changes in this fork
====================
- Added support for table.unpack (Lua 5.2+)
Deep-copy function for Lua - v0.2
==============================
- Does not overflow the stack.
- Maintains cyclic-references
@wassname
wassname / to_filename.py
Last active August 26, 2024 20:59
python convert string to safe filename
"""
Url: https://gist.github.com/wassname/1393c4a57cfcbf03641dbc31886123b8
"""
import unicodedata
import string
valid_filename_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
char_limit = 255
def clean_filename(filename, whitelist=valid_filename_chars, replace=' '):
@MariadeAnton
MariadeAnton / hi-satellite.md
Last active August 7, 2022 18:06
Travis CI Demo Examples - GitHub Satellite 2019
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 16, 2024 22:55
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@SaschaWillems
SaschaWillems / vk.cpp
Last active November 23, 2023 10:02
Multiple Vulkan buffer binding points
Shader
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inColor;
layout (location = 2) in vec3 inPosB;
layout (location = 3) in vec3 inColorB;
...
Application
@MatthewRalston
MatthewRalston / roflcopter.md
Created February 14, 2018 19:03
ROFLcopter ASCII text art

ROFLcopter ASCII

If you hear SOI SOI SOI, you better RUN RUN RUN ’cause the ROFLCOPTER ASCII army is coming for you!

THE ORIGINAL ROFLCOPTER

 ROFL:ROFL:ROFL:ROFL
         _^___
 L __/ [] \