Skip to content

Instantly share code, notes, and snippets.

@dabrahams
dabrahams / private_access.cpp
Created December 28, 2011 17:50
Accessing Private Data
#include <iostream>
// This is a rewrite and analysis of the technique in this article:
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html
// ------- Framework -------
// The little library required to work this magic
// Generate a static data member of type Tag::type in which to store
// the address of a private member. It is crucial that Tag does not
@magpie514
magpie514 / fallvale_mml.c
Created January 6, 2012 11:34
Simple MML parser in C+SDL_Mixer
//Project Fallvale MML parsing component
//Usage:
//You can edit the string "tmp" at main(), or you can pass a MML-formatted string with "-play":
//for example, mmlplay -play "t128 o4 cdec+8>d8e16d16d8e"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <assert.h>
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@yoggy
yoggy / uuid_test.c
Created January 8, 2013 11:19
libuuid sample program
//
// libuuid sample program
//
// library install for debian
// $ sudo apt-get install uuid-dev
//
// compile
// $ gcc uuid_test.c -luuid -o uuid_test
//
#include <stdio.h>
@tsubaki
tsubaki / ScriptableObjectToAsset.cs
Last active May 25, 2024 15:22
ScriptableObjectをAssetsファイルとして出力する汎用スクリプト
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
/// <summary>
// ScriptableObjectをプレハブとして出力する汎用スクリプト
/// </summary>
// <remarks>
// 指定したScriptableObjectをプレハブに変換する。
@urin
urin / makefile
Last active October 20, 2023 15:18
makefile - simple template to make an executable from *.cpp files.
COMPILER = g++
CFLAGS = -g -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
ifeq "$(shell getconf LONG_BIT)" "64"
LDFLAGS =
else
LDFLAGS =
endif
LIBS =
INCLUDE = -I./include
TARGET = ./bin/$(shell basename `readlink -f .`)
@rxaviers
rxaviers / gist:7360908
Last active July 26, 2024 06:58
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@faithandbrave
faithandbrave / emscripten_cmake_build.md
Last active June 11, 2024 21:14
EmscriptenとCMakeでのビルド方法

EmscriptenとCMakeでのビルド方法

Emscriptenは、C++をJavaScriptにコンパイルする、LLVMベースのコンパイラ。

このドキュメントでは、特定のプロジェクトに依存せず、Emscripten向けに、CMakeを使用してC++プロジェクトをビルドする方法を紹介する。

バージョン

このドキュメントで扱う各ツールのバージョンは、以下のものとする:

@umiyuki
umiyuki / RecordManagerEditor.cs
Last active December 9, 2022 04:48 — forked from darktable/SavWav.cs
Record Microphone in EditMode. Need Voice Changer Filter(https://www.assetstore.unity3d.com/jp/#!/content/54963)
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(RecorderManager))]
public class RecoderManagerEditor : Editor {
public override void OnInspectorGUI()
{