Skip to content

Instantly share code, notes, and snippets.

View NocturnDragon's full-sized avatar

X NocturnDragon

View GitHub Profile
@NocturnDragon
NocturnDragon / Swizzles.h
Last active October 15, 2023 01:20
Swizzles in Clang, GCC, and Visual c++
#include <stdio.h>
// #define CLANG_EXTENSION
// Clang compile with -O3
#define VS_EXTENSION
// https://godbolt.org/z/sVWrF4
// Clang compile with -O3 -fms-compatibility
// VS2017 compile with /O3
// Simple color picker by @rianflo
// http://twitter.com/rianflo
// public domain
#ifdef GL_ES
precision highp float;
#endif
uniform float time;
@NocturnDragon
NocturnDragon / PCG.md
Last active August 29, 2015 14:25 — forked from mrcasals/PCG_AI.md
PCG interesting links - nucl.ai

If you want to add links here, leave a comment or ping me by Twitter or GitHub (@mrcasals on both platforms). You can find my email in my GitHub profile too!

Books

Talks & Conference-related stuff

class FileWatcher
{
public:
FileWatcher(const Path& path)
: m_Path(path)
, m_DirHandle(INVALID_HANDLE_VALUE)
, m_BufferSize(CORE_KB(100))
, m_Buffer(nullptr)
, m_ChangedFiles(1024)
{
#
# © 2011 Christopher Arndt, MIT License
#
# Taken from: http://wiki.python.org/moin/PythonDecoratorLibrary
import time
class cached_property(object):
'''Decorator for read-only properties evaluated only once within TTL period.
@NocturnDragon
NocturnDragon / computable_include.h
Created June 27, 2011 17:21
Computable Include
////////////////////////////////////////////////////////////
// <License>
////////////////////////////////////////////////////////////
#pragma once
////////////////////////////////////////////////////////////
// Title: Computable Include
////////////////////////////////////////////////////////////
@NocturnDragon
NocturnDragon / Open_safari_tab_in_google_chrome.scpt
Created June 21, 2011 22:09
Open current safari tab in Google Chrome
property storedURL : ""
tell application "Safari"
set storedURL to URL of current tab of front window
end tell
tell application "Google Chrome"
try
set URL of active tab of front window to storedURL
on error
make new window
set URL of active tab of front window to storedURL