Skip to content

Instantly share code, notes, and snippets.

@NickBeeuwsaert
NickBeeuwsaert / main.py
Last active February 17, 2022 19:43
OpenGL Shader example using python
#!/usr/bin/env python
from __future__ import division
from OpenGL.GL import *
import numpy as np
import math
import pygame
import textwrap
from PIL import Image
vertex_shader_source = textwrap.dedent("""\
@jatinganhotra
jatinganhotra / integral_type_sizes.cpp
Created December 24, 2012 06:21
C++ snippet to list MIN, MAX values & other attributes of Integral Types
#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << "Size of size_t = " << sizeof(std::size_t) << endl << endl;
cout << "Minimum value for bool: " << numeric_limits<bool>::min() << endl;
@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'