Skip to content

Instantly share code, notes, and snippets.

View Phyllostachys's full-sized avatar

Jacob Shaffer Phyllostachys

View GitHub Profile
#include <windows.h>
#include <cstdio>
int main() {
char buf[1024];
auto ret = OpenClipboard(NULL);
if (ret == 0) {
printf("%d\n", ret);
}
@Phyllostachys
Phyllostachys / default_x86_64.txt
Last active September 13, 2017 20:48
Dump of passing -Wl,--verbose to g++ on Debian Stretch.
$ g++ hello.cpp -Wl,--verbose
GNU ld (GNU Binutils for Debian) 2.28
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
elf_iamcu
i386linux
elf_l1om
elf_k1om
@Phyllostachys
Phyllostachys / Pearlescent.shader
Created July 15, 2017 05:05 — forked from cancinconn/Pearlescent.shader
An attempt at a basic pearlescent shader for Unity.
Shader "Custom/Pearlescent" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_ColorDirect("Indirect Color", Color) = (1,1,1,1)
_Iterations("Iridescence Function Iterations (Power)", Range(0,10)) = 5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
@Phyllostachys
Phyllostachys / build_out.txt
Created March 9, 2017 12:59
raylib MinGW-w64 build output
$ make
gcc -c utils.c -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces -I. -Iexternal -Iexternal/glfw3/include -Iexternal/openal_soft/include -DPLATFORM_DESKTOP -DBUILDING_STATIC
In file included from rres.h:129:0,
from utils.c:60:
external/tinfl.c: In function 'tinfl_decompress':
external/tinfl.c:301:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
^~~
external/tinfl.c:301:47: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
@Phyllostachys
Phyllostachys / ternary-nesting
Last active August 29, 2015 14:01
I was wondering about some of the properties of the ternary operater after discussing them with fellow employees. Apparently, they are very flexible. These seem to work on Coliru: http://coliru.stacked-crooked.com/.
//http://coliru.stacked-crooked.com/a/2011cdffc3009e8d
#include <stdio.h>
int main(void) {
int blah = 5;
blah > 12 ? blah < 10
? blah == 5
? printf("win")
: printf("3")
: printf("2")