Skip to content

Instantly share code, notes, and snippets.

@luizcarraro
luizcarraro / open-external-link.js
Created July 27, 2017 11:37
ELECTRON: Open link in external default OS browser
@cryzed
cryzed / fix-infinality.md
Last active September 3, 2025 06:53
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@jonschlinkert
jonschlinkert / zip.js
Last active February 8, 2024 08:26
versatile JavaScript "zip" function. Works with objects, arrays, and yep - even strings.
function zip(a, b) {
var arr = [];
for (var key in a) arr.push([a[key], b[key]]);
return arr;
}
console.log(zip('foo', 'bar'));
//=> [ [ 'f', 'b' ], [ 'o', 'a' ], [ 'o', 'r' ] ]
console.log(zip(['a', 'b', 'c'], ['x', 'y', 'z']));
@thenickdude
thenickdude / sfinae.cpp
Created February 22, 2016 10:27
C++ SFINAE: Call a 2 argument constructor if it exists for a templated type, otherwise call the no-arg constructor
#include <iostream>
#include <type_traits>
#include <cstdint>
#include <cstddef>
// Or we can use enable_if from Boost:
template <bool, typename T = void>
struct enable_if {
};
@alexr
alexr / GrammarEnumeration.fs
Created October 25, 2014 22:13
This is an F# implementation of the Omega monad as it appears, more or less, on http://hackage.haskell.org/package/control-monad-omega. Type annotations are for reading convenience.
(**
And of cause translation of the context free grammar enumeration example
from [Luke Palmer's post](http://lukepalmer.wordpress.com/2008/05/02/enumerating-a-context-free-language/)
which was my original inpiration to use Omega.
Notice the explicit addition of laziness to allow recursive use of
`symbol` literals in a list. Alternatively one can define, say:
```
type 'a symbol =
| Terminal of 'a
@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing