Skip to content

Instantly share code, notes, and snippets.

View nswutong's full-sized avatar

nswutong nswutong

  • Fuzhou, Fujian, China
View GitHub Profile
@eahydra
eahydra / self_coroutine.cpp
Last active December 15, 2015 09:19
自己实现的基于FSM的coroutine
#define begin() \
static unsigned int state_ = 0;\
switch (state_) \
case 0:
#define _yield_impl(x_, z_) \
do { \
state_ = z_; \
##x_; \
goto exit__;\
@eahydra
eahydra / coroutine_executor_ex.cpp
Last active September 25, 2021 09:16
asio's truth code
void coroutine_executor_ex() {
std::cout<<__FUNCTION__<<std::endl;
coroutine_ref _coro_value = this;
switch (_coro_value)
{
case -1:
{
if (_coro_value)
{
goto terminate_coroutine;
@archagon
archagon / gdc-downloader.py
Last active April 12, 2025 19:12
A quick and dirty script to download GDC Vault videos.
# GDC Vault videos can't be watched on mobile devices and this is a very sad thing indeed!
# (Note: this has changed for GDC2013, which lets you watch raw MP4 streams. Kudos!)
# This script is designed to circumvent this by downloading the lecture and slideshow
# videos which can then be re-encoded into whatever format you wish. Obviously, you
# won't be able to do this without access to the Vault. This is strictly for the
# convenience of legitimate Vault users!
# Note: this code is rather flimsy and was written as fast as possible for my own personal use.
# The code only works for the most recent GDC Vault videos, since they all use the same player
# format. If the XML format used to run the player is changed (as it has in the past), the code
@AngryAnt
AngryAnt / Build.sh
Created September 30, 2012 07:21
Example code for "Downloading the hydra" blog post on AngryAnt.com
mcs -target:library -out:MyAssembly.dll -r:/Applications/Unity/Unity.app/Contents/Frameworks/UnityEngine.dll MyAssembly.cs