Skip to content

Instantly share code, notes, and snippets.

@pervognsen
pervognsen / dotgen.py
Last active September 19, 2019 06:00
class DotGenerator(Visitor):
def __init__(self):
super().__init__()
self.lines = []
self.next_id = 0
def make_name(self, node, name=None):
if name is None:
name = "n%d" % self.next_id
self.next_id += 1
@sebbbi
sebbbi / BDF2_integrate_HLSL.txt
Last active March 28, 2018 19:28
BDF2 integrator in HLSL
void BFD2(inout ParticleSimulationData Particle, float3 Accel)
{
float3 x = Particle.Position;
float3 v = Particle.Velocity;
float3 x1 = Particle.PositionPrev;
float3 v1 = Particle.VelocityPrev;
Particle.Position = (4.0/3.0) * x - (1.0/3.0) * x1 + 1.0 * ((8.0/9.0) * v - (2.0/9.0) * v1 + (4.0/9.0) * TimeStep2 * Accel);
Particle.PositionPrev = x;
@dwilliamson
dwilliamson / Reflection.h
Created February 3, 2018 23:20
Basic compile-time reflection for C++11
#pragma once
#include <typestring/typestring.hh>
namespace rfl
{
// Compile-time data member description
@ChemistAion
ChemistAion / Nodes.cpp
Created January 25, 2018 15:02
Prototype of standalone node graph editor for ImGui
// Prototype of standalone node graph editor for ImGui
// Thread: https://github.com/ocornut/imgui/issues/306
//
// This is based on code by:
// @emoon https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2
// @ocornut https://gist.github.com/ocornut/7e9b3ec566a333d725d4
// @flix01 https://github.com/Flix01/imgui/blob/b248df2df98af13d4b7dbb70c92430afc47a038a/addons/imguinodegrapheditor/imguinodegrapheditor.cpp#L432
#include "Nodes.h"
@Leandros
Leandros / main.c
Last active December 3, 2018 12:01
Lua C preprocessor
/*
* Copyright (c) 2018 Arvid Gerstmann.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
#include <stdio.h>
/*lua!
local func = [[

API Design: Coroutines APIs (Janurary-2017)

I am currently dealing with a lot of libraries at work. Both third party as well as libraries written or being currently in process of being written by me. I absolutely love writing and working with libraries. Especially if they present or bring me to either a new or different approach to solve a problem. Or at least provide a different view.

Over time I noticed however that quite regulary we had to decide that we cannot use a third party library. Often it is the usual reason.

@jcupitt
jcupitt / danila.cpp
Last active June 20, 2016 11:30
test vips memory behaviour
/* compile with
*
* g++ -g -Wall danila.cpp `pkg-config vips --cflags --libs`
*/
#include <vector>
#include <string>
#include <iostream>
#include <vips/vips.h>
@alirobe
alirobe / reclaimWindows10.ps1
Last active November 15, 2024 12:08
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@thennequin
thennequin / NumericSlider.h
Last active October 24, 2022 09:38
Template numeric slider for ImGui
/*
Exemple:
float fValue = 1.f;
DragNumeric("Float", &fValue, 1.0, 0.f, 0.f, "%f");
double fDoubleValue = 1.f;
DragNumeric("Double", &fDoubleValue, 1.0, 0.0, 0.0, "%lf");
*/