Skip to content

Instantly share code, notes, and snippets.

@rg3
rg3 / vulkan-invalid-stype.cpp
Created February 17, 2021 19:01
Vulkan program using invalid sType value
#include <vulkan/vulkan.h>
#include <iostream>
int main(void)
{
VkInstance instance = VK_NULL_HANDLE;
const VkApplicationInfo appInfo =
{
@rg3
rg3 / perms.cc
Created December 7, 2010 09:48
Simple code to show how to generate permutations in C++
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using std::copy;
using std::cout;
using std::endl;
using std::vector;
@rg3
rg3 / combs.cc
Created December 7, 2010 09:43
Simple code to create combinations in C++
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using std::copy;
using std::cout;
using std::endl;
using std::vector;
@rg3
rg3 / combs_repeat.cc
Created December 7, 2010 09:47
Simple code to show how to create combinations with repetitions in C++
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using std::copy;
using std::cout;
using std::endl;
using std::vector;
@rg3
rg3 / hello.sh
Created December 29, 2010 16:38
Shell script that created the hello.png image
#!/bin/sh
convert -density 72x72 -size 10000x5000 xc:white \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+1020 '#include <stdio.h>' \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+1740 'int main(void)' \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+2100 '{' \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+2460 ' printf(\"Hello, World!\\n\");' \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+2820 ' return 0;' \
-font Liberation-Mono-Regular -pointsize 360 -fill grey -annotate +1120+6340 '}' \
-font Liberation-Sans-Bold -pointsize 160 -fill \#eeccff -annotate +5020+4020 'Dennis M. Ritchie' \
-font Liberation-Sans-Italic -pointsize 160 -fill \#eeccff -annotate +5020+4180 'The C Programming Language, Second Edition' \
@rg3
rg3 / keybase.md
Created September 22, 2014 18:16
keybase.md

Keybase proof

I hereby claim:

  • I am rg3 on github.
  • I am rg3 (https://keybase.io/rg3) on keybase.
  • I have a public key whose fingerprint is 3E9A 8D56 E7B7 2DF3 65DF D81F 55D9 266C 0CC6 9CED

To claim this, I am signing this object: