Skip to content

Instantly share code, notes, and snippets.

View moisadoru's full-sized avatar

Doru Moisa moisadoru

View GitHub Profile
@moisadoru
moisadoru / style.css
Last active July 25, 2023 06:45
Tilda custom GTK style (including a fix for the scrollbar). Do a backup of the old file, and copy this one to ~/.config/tilda/style.css
/*
The .8 transparency value can be calculated using the transparency config value (V)
with the formula: (100-V)/100. I have the transparency set to 20, so when I apply the
formula, I get: (100-20)/100 = 80/100 = 0.8 = .8
For no transparency (V = 0), set the value to 1.
*/
notebook > header {
background-color: rgba(0,0,0,.8);
border: none;
#!/bin/bash
NODE_VERSION=$(node --version)
NODE_VERSION_SHORT="${NODE_VERSION/v/}"
function download_missing_node_gyp_file {
BUG_20921_FILE="~/.node-gyp/$NODE_VERSION_SHORT/include/node"
BUG_20921_URL="https://raw.githubusercontent.com/nodejs/node/$NODE_VERSION/src"
curl -s "$BUG_20921_URL/$1" -o "$BUG_20921_FILE/$1"
}
#/bin/bash
# Installs libfreetype6 2.8.0 into affected electron app.
# For more details ee:
# https://github.com/atom/atom/issues/15737
# https://github.com/Microsoft/vscode/issues/35675
CRT=$(dpkg-query --showformat='${Version}' --show libfreetype6)
CRT=$(echo $CRT | sed -e 's/-.*$//g')
@moisadoru
moisadoru / gist:5087157
Last active December 14, 2015 12:29
Some thoughts on caching in general, and a possible PSR Caching proposal

A. Caching systems in general:

  • there are many caching systems out there, with totally different APIs, levels of complexity, implementations and use-cases, so a minimum common API should provide some level of portability.
  • caching systems can work synchronously or asynchronously
  • usually caching systems store items for a limited amount of time (expiration, time-to-live, etc.)
  • some caching systems expose the expiration information in their API, others don't
  • those caching systems who use expiration may chose to use a predefined value, a system imposed value, or let the API consumer specify a value
  • the most basic operations are the storing and retrieval of things from the cache