Skip to content

Instantly share code, notes, and snippets.

@kwent
kwent / 20200119064500_add_position_column_to_active_storage_attachments.rb
Last active February 3, 2024 16:25
Rails | Active Storage Attachment + acts_as_list
# db/migrate/20200119064500_add_position_column_to_active_storage_attachments.rb
class AddPositionColumnToActiveStorageAttachments < ActiveRecord::Migration[6.0]
def change
add_column :active_storage_attachments, :position, :integer, default: 0
end
end
@mimetaur
mimetaur / !norns_on_mac.md
Last active June 18, 2023 13:45
Norns Engine Development on MacOS - quick guide
  1. Pull the norns repository

  2. Make symbolic links from norns sc folders -> SuperCollider Extensions folder:

    • ln -s ~/Developer/monome/norns/sc/core ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-core
    • ln -s ~/Developer/monome/norns/sc/engines ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-engines
    • ln -s ~/Developer/monome/norns/sc/ugens ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-ugens
  3. Make symlinks to Norns community repos e.g. ln -s ~/Developer/monome/we/ ~/Library/Application\ Support/SuperCollider/Extensions/monome-we

  4. Make symlinks for custom engine development

Response to px_render.h rationale "but..." section of bgfx

Context:
https://web.archive.org/web/20180705002109/https://pplux.github.io/why_px_render.html

bgfx records render commands in global variables (or thread local variables), making impossible to use a task-based scheduler if you want to split your render between different tasks that might be executed from different threads.

bgfx does support submission from multiple threads via bgfx::Encoder interface:

Secret Mojo Recipe

I'm about to share with you the most important piece of knowlege that's been passed down generation to generation through millennia in the Canary Islands: the recipe of Mojo Picón.

This secret sauce is known to have beneficial effects on your health and it instantly improves any food. It doesn't really matter what other food you add to your Mojo, but it is usually combined with "Papas arrugás" because they are cheap and readily available and also have magical properties when prepared

@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active April 4, 2024 13:42
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@mbinna
mbinna / effective_modern_cmake.md
Last active April 18, 2024 19:26
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

Clojure Metal Wishlist

  • Seamless interop with C/C++
  • Reasonable Binary sizes (Dead Code Elimination)
  • Memory/CPU Efficient
  • Cache efficient data structures
  • Deterministic performance characteristics (Optional GC)
  • Simple interpreter for restricted platforms (iOS, etc.)
  • REPL and hot code reloading (interpreted and native)
(import [UnityEditor RagdollBuilder])
;-)
(defn- invoke-private [obj meth & args]
(.Invoke
(.GetMethod
(type obj) meth
(enum-or BindingFlags/Instance
BindingFlags/NonPublic))
obj