Skip to content

Instantly share code, notes, and snippets.

View joernassimian's full-sized avatar

Joe R. Nassimian joernassimian

  • Vienna -- Austria
View GitHub Profile
@joernassimian
joernassimian / vo_battery.lua
Created December 5, 2019 23:07 — forked from ekisu/vo_battery.lua
vo_battery.lua implementation for Linux
-- If the laptop is on battery, the VO set in the config will be choosen,
-- else the one defined with „hqvo“ is used.
local hqvo = "opengl-hq:interpolation"
local utils = require 'mp.utils'
if mp.get_property_bool("option-info/vo/set-from-commandline") == true then
return
end
t = {}
t.args = {"/bin/cat", "/sys/class/power_supply/AC/online"}
res = utils.subprocess(t)
@joernassimian
joernassimian / PROGMEM.md
Created April 25, 2017 04:31 — forked from sticilface/PROGMEM.md
PROGMEM

Guide to PROGMEM on ESP8266 and Arduino IDE

Intro

On low memory devices like the arduino and esp8266 you do not want strings to be stored in RAM. This occurs by default on these systems. Declare a string const char * xyz = "this is a string" and it will use up RAM.

The solution on these devices is to allow strings to be stored in read only memory, in Arduino this is the PROGMEM macro. Most of my experience is with the ESP8266 which is a 32bit micros controller. This device stores PROGMEM data in flash. The macro PROGMEM on ESP8266 is simply

#define PROGMEM   ICACHE_RODATA_ATTR