Skip to content

Instantly share code, notes, and snippets.

View benloong's full-sized avatar

benloong benloong

View GitHub Profile
@dbechrd
dbechrd / 20230108_dbechrd_sdl2_quick_reference.c
Last active November 27, 2024 07:18
SDL 2 API Quick Reference
Moved to: https://blog.theprogrammingjunkie.com/post/sdl2-cheatsheet/
@raysan5
raysan5 / open_source_and_videogames.md
Last active February 15, 2025 00:33
Open Source and Videogames - Resources

open_source_and_videogames

Open Source and Videogames - Resources

This git include a list of programs, tools, engines and libraries free and open source intended to make videogames.

NOTE: This gist is a support material for the talk "Open Source and Videogames" given by me, Ramon Santamaria, on October 26th 2021 in Canòdrom, Barcelona. All the materials listed here were explained in detail in a +2 hours talk.

Contents

Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@d3x0r
d3x0r / ABOUT.md
Created June 8, 2020 18:34
Node BackingStore Debug Crash

You can download this gist as a single repository.

build

node-gyp configure --debug
node-gyp build --debug
@IJEMIN
IJEMIN / NavMeshUtil.cs
Created August 20, 2018 14:08
Get Random Position on NavMesh in Unity
using UnityEngine.AI;
using UnityEngine;
public static class NavMeshUtil {
// Get Random Point on a Navmesh surface
public static Vector3 GetRandomPoint(Vector3 center, float maxDistance) {
// Get Random Point inside Sphere which position is center, radius is maxDistance
Vector3 randomPos = Random.insideUnitSphere * maxDistance + center;
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@mbinna
mbinna / effective_modern_cmake.md
Last active May 2, 2025 03:17
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@idbrii
idbrii / botw-cedec2017.md
Last active January 29, 2025 23:58
An inline image version of Matt Walker's translation of CEDEC 2017 talks by Nintendo
@astyagun
astyagun / gem-list-leaves
Last active December 11, 2024 03:39
List Ruby gems, that are not a dependency of any other gem (analog of `brew leaves`)
#!/bin/sh
# List Ruby gems, that are not a dependency of any other gem (analog of `brew leaves`)
# https://gist.github.com/astyagun/290b783045afffb8190a0c75ab76d0fa
GEMS_FILE=`mktemp`
DEPENDENCIES_FILE=`mktemp`
gem list -l | sed 's/ (.*//' | sort > $GEMS_FILE
cat $GEMS_FILE | xargs -n1 gem dependency -l --pipe | sed 's/ --version.*//' | sort -u > $DEPENDENCIES_FILE
comm -23 $GEMS_FILE $DEPENDENCIES_FILE
// http:// stackoverflow.com/questions/23202489/how-does-this-code-find-the-number-of-trailing-zeros-from-any-base-number-factor
// https://comeoncodeon.wordpress.com/2010/02/17/number-of-zeores-and-digits-in-n-factorial-in-base-b/
function zeroes (base, number) {
var noz = Number.MAX_VALUE;
// Now we can break the Base B as a product of primes :
// B = a^p1 * b^p2 * c^p3 * …
//Then the number of trailing zeroes in N factorial in Base B is given by the formulae
// min{1/p1(n/a + n/(a*a) + ….), 1/p2(n/b + n/(b*b) + ..), ….}.
var j = base;