Skip to content

Instantly share code, notes, and snippets.

View greyfade's full-sized avatar

Charles Banas greyfade

View GitHub Profile
/* I'm a C++ programmer by day, so when I saw this problem, I thought it would
* be worthwhile to hack it up. I changed the variable names to help me think
* about the problem, not for some kind of obfuscation. I'm curious how my
* solution compares to solutions devised by C programmers. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void condense_by_removing(char *s, char rm) {
class Foo;
class Bar;
int fun (bool baz) {
int code = 0;
if(baz) {
Foo launch_silo;
code = launch_silo.code1;
goto whoops;
}
@greyfade
greyfade / CMakeLists.txt
Created December 22, 2011 02:28
a cmake example
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
# default configuration
set(USE_SFML OFF CACHE BOOL "Prefer SFML framework")
set(USE_GLFW ON CACHE BOOL "Prefer GLFW framework")
project(r3d CXX C)
zstyle ':completion:*' completer _complete _ignored
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'r:|[._-]=** r:|=**'
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/home/greywolf/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
@greyfade
greyfade / hw_video.tsv
Created August 19, 2013 03:59
From July's Steam Hardware Survey results, the list of graphics hardware, by OpenGL version, in TSV format. Columns are: Manufacturer, Card name, Percent market share, maximum supported OpenGL version. There's a lot of rounding going on in Valve's report, so the normalized totals are probably wrong.
ATI 760G 0.15% 3.3
ATI Mobility FireGL V5725 0.01% 2.1
ATI Mobility Radeon 4100 0.01% 2.0
ATI Mobility Radeon HD 2300 0.00% 2.0
ATI Mobility Radeon HD 2400 0.04% 2.0
ATI Mobility Radeon HD 2600 0.04% 2.0
ATI Mobility Radeon HD 3430 0.02% 2.0
ATI Mobility Radeon HD 3470 0.15% 2.0
ATI Mobility Radeon HD 3650 0.09% 2.0
ATI Mobility Radeon HD 3850 0.00% 2.0
#include <string.h>
/* force memcpy from old glibc for compatibility */
#ifdef __amd64__
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
#else
__asm__(".symver memcpy,memcpy@GLIBC_2.0");
#endif /*__amd64__*/
void *__wrap_memcpy(void *dest, const void *src, size_t n)
@greyfade
greyfade / params.txt
Last active August 29, 2017 20:32
zompist gen params
P=ptq
F=ʃʒfhχ
N=nŋ
R=ɾ
B=ʙʀ
V=ɯæiɑ
np|mp
æh|æʔ
ʃ|sh

Keybase proof

I hereby claim:

  • I am greyfade on github.
  • I am greyfade (https://keybase.io/greyfade) on keybase.
  • I have a public key ASALGDeIXGvvJxbbW1NbrrQf6GbUkKdb_FcWfwuRgXHOPAo

To claim this, I am signing this object: