Skip to content

Instantly share code, notes, and snippets.

@bradwilson
bradwilson / InlineTask.targets.xml
Created March 11, 2012 00:41
Inline MSBuild task to download NuGet.exe
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
(set -e && ls content/*.markdown | while read p; do DATE=$(echo $p | cut -d '/' -f 2 | cut -d '-' -f 1-3); TARGET=$(echo $p | sed 's/-/\//' | sed 's/-/\//' | sed -E 's/[0-9]+-//' | perl -pe 's/^(.*\/.*\/.*\/)(.)(.*)$/\1\u\2\3/' | sed -E 's/-|_/ /g'); echo $TARGET; mkdir -p $(dirname $TARGET); echo "<\!-- $DATE -->" > $TARGET; cat $p >> $TARGET; rm $p; done)
@rygorous
rygorous / iggy_focus.cpp
Created October 14, 2013 19:46
Iggy focus handling
enum FocusDir
{
DIR_W,
DIR_E,
DIR_N,
DIR_S
};
static FocusDir get_quadrant(float dx, float dy)
{
@Groovounet
Groovounet / gist:7258805
Created October 31, 2013 23:21
Checking all the OpenGL capabilities from 2.1 to 4.4
struct caps
{
enum profile
{
CORE = 0x00000001,
COMPATIBILITY = 0x00000002,
ES = 0x00000004
};
private:
@bkaradzic
bkaradzic / gist:8487361
Last active January 3, 2016 16:09
Using SteamBox as DevKit

Using SteamBox as DevKit

In SteamOS go to Settings / Intefrace and check "Enable access to the Linux desktop" option.

Click on Exit, choose "Return to Desktop".

Open terminal and set password so sudo can work:

passwd
@csfrancis
csfrancis / gdb_ruby_backtrace.py
Last active April 24, 2024 05:37
Dump an MRI call stack from gdb
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@pervognsen
pervognsen / SDL_stb.h
Last active August 29, 2015 14:07
SDL_stb
#ifndef _SDL_stb_h
#define _SDL_stb_h
// Memory buffers
typedef struct
{
Uint8 *data;
Uint32 size;
} SDL_MemoryBuffer;
@ocornut
ocornut / (Archived) imgui_memory_editor.h
Last active January 1, 2024 04:27
Mini memory editor for dear imgui (to embed in your game/tools)
// Mini memory editor for Dear ImGui (to embed in your game/tools)
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112
// THE MEMORY EDITOR CODE HAS MOVED TO GIT:
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor
// Click "Revisions" on the Gist to see old version.
@radiatoryang
radiatoryang / DecentWater.shader
Last active September 26, 2015 22:09
a not-cheap but not-expensive water shader, decent quality DX9 2012-era water, by Robert Yang (@radiatoryang)
// a not-cheap but not-expensive water shader
// decent quality DX9 2012-era water, by Robert Yang (@radiatoryang)
// based on:
// built-in legacy Alpha-Bumped shader
// added cubemap reflection and rimlight stuff
// GlassStainedBumpDistort from Unity glass refraction demo
// http://forum.unity3d.com/threads/grabtexture-uv-correction-in-surface-shader.67742/
// ... this does NOT have fogging or edge blending (too expensive / annoying?)