Skip to content

Instantly share code, notes, and snippets.

View LordAlbior's full-sized avatar
🏠
Working from home

Albert Tavares de Almeida LordAlbior

🏠
Working from home
  • Good Dog Games
  • Brasilia
View GitHub Profile
@methanoliver
methanoliver / smallcaps.rpy
Last active October 27, 2024 23:28
Smallcaps tag for RenPy.
# Released under the terms of WTFPL public license: Do whatever you please with it.
# Smallcaps tag: {sc}
#
# Usage:
#
# This will be {sc}excellent{/sc}
#
# In some situations, giving an explicit size to the small caps letters
# may be required:
#
@greatsharma
greatsharma / particle_swarm_optimization.cpp
Created April 8, 2019 07:30
This is a simple c++ program on particle swarm optimization, this pso optimizes a sphere function and can optimize other functions by defining those functions appropriately.
#include <iostream>
#include <time.h>
#define INFINITY 100000.0
using namespace std;
class PSOTestFunction
{
public:
/**
@koturn
koturn / CMakeLists.txt
Created March 9, 2019 16:36
CMakeLists.txtのテンプレート
cmake_minimum_required(VERSION 3.1)
project(CMakeProject CXX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
@ctsrc
ctsrc / .gitignore
Last active February 14, 2025 19:03
Random dungeon generator from https://news.ycombinator.com/item?id=19309378, deobfuscated, refactored and commented
/.idea/
/cmake-build-debug/
/dungeon
# @brief Downloads and Includes cmake-conan
# @param VERSION -- The cmake-conan release version to get. Commit codes
# also applicable.
# @option INSTALL -- Specifies if cmake-conan should be installed to the user's home directory.
# This allows cmake-conan to only be downloaded once, rather than every
# time the build directory is cleaned.
# @note Browse release versions at: https://github.com/conan-io/cmake-conan/releases
# @note cmake-conan is a CMake wrapper for the Conan C and C++ package manager.
# It allows cmake to automatically configure and launch `conan install` as
# part of cmake configuration. It will take CMake current settings (os,
@wipe2238
wipe2238 / SelfUpdate.cmake
Last active August 11, 2019 17:22
CMake script updating CMake
##
## Automagically update CMake to version required by build
##
## NOTES:
## - DOWNLOAD_DIR/cmake/bin/ must be added to PATH before running this script
## - [bash] running "hash -r" after this script (but before starting build) might be required
## when downloading CMake for a first time
## - [win] updating running executable might be "tricky" on windows, it's better to delete DOWNLOAD_DIR/cmake/
## when required version might change (eg. using AppVeyor' cache invalidation)
##
@WesThorburn
WesThorburn / 1.Instructions.md
Last active July 29, 2025 13:21
Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Download and Install Emscripten

  • My preferred installation location is /home/user
  • Get the latest sdk: git clone https://github.com/emscripten-core/emsdk.git
  • Enter the cloned directory: cd emsdk
  • Checkout main: git checkout main
  • Install the lastest sdk tools: ./emsdk install latest
  • Activate the latest sdk tools: ./emsdk activate latest
  • Activate path variables: source ./emsdk_env.sh
@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@Keenuts
Keenuts / readme.md
Last active August 13, 2023 11:59
GSoC 2018 | Vulkan-ize VirGL

GSoC 2018 | Vulkan-ize VirGL

GSoC 2018 is coming to an end. This GIST will present you this project in its current state (August 10, 2018).

Current state

We can run a sample vulkan compute application, R/W data to/from the server, and execute a compute shader.

Project links