Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
@Couto
Couto / get.js
Created July 13, 2018 14:50
Lodash's .get() similar
/**
*
* @param {any} defaultValue
* @param {String} propertyPath 'a.b.c.4'
* @param {any} obj | defaultValue
* @example getValue('foo', 'a.b.c.4', { a:{ b:{ c: [0, 1, 2, 3] } } }) // 3
*/
var getValue = exports.getValue = function (defaultValue, propertyPath, obj) {
var paths = propertyPath.split('.');
var currentObj = obj;
@Couto
Couto / .flowconfig
Last active June 23, 2018 19:30
Flow focus-check example
[ignore]
[include]
[libs]
[lints]
[options]
@Couto
Couto / gist:4eedfa4b3d2ff58985389f316b1ece83
Last active April 17, 2022 16:39
Fix GPS settings in One Plus One with LineageOS

Connect to the phone via adb

adb shell

Request root access (has to be enabled in Developer settings).
Re-mount the /system with write permissions.
Edit the relevant configurations.

su
@Couto
Couto / combinators.js
Created February 20, 2018 12:12 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@Couto
Couto / map.js
Created February 10, 2017 23:46
const map = (predicate, list) => {
if (!list.length) { return list; }
return [].concat(list) // TODO
};
{-
--- Day 1: No Time for a Taxicab ---
Santa's sleigh uses a very high-precision clock to guide its movements, and the
clock's oscillator is regulated by stars. Unfortunately, the stars have been
stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve
all fifty stars by December 25th.
Collect stars by solving puzzles. Two puzzles will be made available on each day
in the advent calendar; the second puzzle is unlocked when you complete the
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama
angular
.module('PersonMod', [])
.factory('Person', function () {
function Person() {};
Person.create = function (data) {
return new Person(data);
};
return Person;
})
.service('PersonLoader', [function() {
@Couto
Couto / name.webbj74
Created July 27, 2016 08:16 — forked from webbj74/name.webbj74
OSX Packet Filter Rules for using privateinternetaccess.com VPN
#
# OSX packet filter rules
# References:
# * https://gist.github.com/scy/8122924
#
# The purpose of this config is to make sure that my system uses the
# privateInternetAccess VPN connection for everything and not to communicate
# unencrypted when the VPN connection goes down. Therefore, I block
# everything on the physical interfaces except for ICMP, DHCP, DNS and the