Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonardo Etcheverry legumbre

  • GlamST / Ulta
  • Montevideo, Uruguay
View GitHub Profile
@legumbre
legumbre / input_glsl.frag
Created Apr 5, 2021
SPIRVCross | GLSL specialization constants -> MSL
View input_glsl.frag
#version 310 es
precision mediump float;
layout (constant_id = 0) const bool kSomeFlag = true;
layout(location = 0) out vec4 FragColor;
void main()
{
if (kSomeFlag)
@legumbre
legumbre / integrated_GPUs_Metal.md
Last active Oct 21, 2020
Using the Integrated GPU with Metal
View integrated_GPUs_Metal.md

Using Integrated GPU with Metal

The following steps were required to get a Metal-based renderer on macos Mojave (10.4.6) to use the Intel (Integrated) GPU instead of the AMD discrete one (High Perf GPU).

  1. Do not use MTLCreateDefaultDevice. Instead, use MTLCopyAllDevices to get a list of all available GPUs and then keep the one satisfying device.lowPower == true

  2. Set "Supports Automatic Graphics Switching" (NSSupportsAutomaticGraphicsSwitching)key in the App's Info.plist to YES

Launch Activity Monitor and verify the App is now listed with "Requires High-Perf GPU: NO".

View gist:30ae6cec253c017441649604e6faff81
> for i=1,63 do print(bit.lshift(0x1ULL,i)) end
2ULL
4ULL
8ULL
16ULL
32ULL
64ULL
128ULL
256ULL
512ULL
View gist:771c693d04980a7b0eb5a9d78cee1de8
/ > pwd
/
/ > ls
--- 35 waves
/ > whereis //spawns
/waves/wave[1]/spawns
/waves/wave[2]/spawns
/waves/wave[3]/spawns
/waves/wave[4]/spawns
/ > whereis /spawn
View gist:b565cc3e13e227bda32dcfa8e5cff3ae
pyftsubset -- OpenType font subsetter and optimizer
pyftsubset is an OpenType font subsetter and optimizer, based on fontTools.
It accepts any TT- or CFF-flavored OpenType (.otf or .ttf) or WOFF (.woff)
font file. The subsetted glyph set is based on the specified glyphs
or characters, and specified OpenType layout features.
The tool also performs some size-reducing optimizations, aimed for using
subset fonts as webfonts. Individual optimizations can be enabled or
disabled, and are enabled by default when they are safe.
View gist:854ea4099a226b28c040a504eca10928
(000a) is blank (p=0.000000)
char (0020) is blank (p=0.000000)
char 猾 (733e) is blank (p=0.000000)
char 贄 (8d04) is blank (p=0.000000)
char 謳 (8b33) is blank (p=0.000000)
char 爬 (722c) is blank (p=0.000000)
char 掟 (639f) is blank (p=0.000000)
char 狡 (72e1) is blank (p=0.000000)
char 榴 (69b4) is blank (p=0.000000)
char 眷 (7737) is blank (p=0.000000)
@legumbre
legumbre / frameworks.txt
Last active Aug 27, 2016
love-osx-frameworks-0.10 dir structure
View frameworks.txt
# find . -type d -name '*.framework' -print0 | xargs -0 ls -al
./Lua.framework:
total 40
drwxr-xr-x@ 7 leo wheel 238 Dec 21 2015 .
drwxr-xr-x@ 12 leo wheel 408 Dec 22 2015 ..
-rw-r--r--@ 1 leo wheel 6148 Dec 21 2015 .DS_Store
lrwxr-xr-x 1 leo wheel 24 Aug 26 20:10 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 leo wheel 14 Aug 26 20:10 Lua -> Versions/A/Lua # symlink should be: Lua -> Versions/Current/Lua
lrwxr-xr-x 1 leo wheel 26 Aug 26 20:10 Resources -> Versions/Current/Resources
View lua-mode.el
;;; lua-mode.el --- a major-mode for editing Lua scripts
;; Copyright (C) 1997, 2001, 2004, 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
;; Author: 2011 immerrr <immerrr+lua@gmail.com>
;; 2010-2011 Reuben Thomas <rrt@sc3d.org>
;; 2006 Juergen Hoetzel <juergen@hoetzel.info>
;; 2004 various (support for Lua 5 and byte compilation)
;; 2001 Christian Vogler <cvogler@gradient.cis.upenn.edu>
;; 1997 Bret Mogilefsky <mogul-lua@gelatinous.com> starting from
@legumbre
legumbre / flymake-lua.el
Created Apr 8, 2016
flymake with LuaJIT
View flymake-lua.el
;;; flymake configuration for lua
;;; assumes luajit is in $PATH
;;; Install:
;; copy flymake-lua.el somewhere in your load-path
;;
;; in ~/.emacs:
;; (eval-after-load 'lua-mode '(add-hook 'lua-mode-hook 'flymake-lua-setup))
;; (autoload #'flymake-lua-setup "flymake-lua" nil t)
@legumbre
legumbre / tn.lua
Created Nov 17, 2015
Play tn.com.ar stream with VLC
View tn.lua
--
-- VLC SD extension for tn.com.ar
--
-- Server will return 403 (Forbidden) for VLC's User Agent so we fake
-- it by using the iPad UA.
--
-- Place this script under ~/Library/Application Support/org.videolan.vlc/lua/sd/ (Mac OS X)
local iPad_UA = "Mozilla/5.0 (iPad; CPU OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B410 Safari/600.1.4"