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
const curry = fn =>
function cf(...args) {
return args.length >= fn.length
? fn(...args)
: (...newArgs) => cf(...[...args, ...newArgs]);
};
const element = curry((element, attributes, children) => {
const el = Object.keys(attributes).reduce(
(el, attribute) => el.setAttribute(attribute, attributes[attribute]),
@Couto
Couto / raspberry-pi_kodi_livestreampro_tv-portuguesa.md
Last active May 1, 2019 20:25
Raspberry Pi with Kodi, LiveStreamsPro and TV Portuguesa

Raspberry Pi with Kodi, LiveStreamsPro and TV Portuguesa

I'm currently testing OpenElec as a way of having Kodi running on a Raspberry Pi, I'm not a particular fan, but it seems to work fine.

  1. Download the OpenElec image file for the Raspberry Pi.
  2. Uncompress the downloaded file tar -xzf OpenELEC-Generic.x86_64-5.0.8.tar
  3. Follow the "Install the system to the SD card" instructions on the ArchLinux on a Raspberry Pi gist
  4. Download the ZIP from the Shani-08/ShaniXBMCWork
  5. Save the URL: http://pastebin.com/raw.php?i=s5ZyhaHB
@Couto
Couto / changelog.sh
Last active March 7, 2019 16:12
Create a short changelog between two tags
git shortlog -e --format="%h %s" <last_tag>..HEAD | git tag -s <new_tag> -F -
```
First Name <email@example.com> (5):
f2b7c5c Add support for multiple environments (#3)
ac202d9 Configure read_only mode (#5)
024d580 Convert `read_only_dashboard` to string (#6)
dcfa003 Add monitors submodule (#7)
fa92fc2 Fix metrics' properties (#8)
# Create the patch
git reset --hard origin/master
git format-patch -o /tmp -1 HEAD > /tmp/patch-name
# For each service
git checkout master
git pull --ff-only
git checkout -b "$(basename -s .patch $(cat /tmp/patch-name))"
git am -3 "$(cat /tmp/patch-name)"

Keybase proof

I hereby claim:

  • I am Couto on github.
  • I am couto_yld (https://keybase.io/couto_yld) on keybase.
  • I have a public key whose fingerprint is DAD8 A82B 1EBA 55FE 0FD8 BB82 D64F 0C33 E970 FB79

To claim this, I am signing this object:

@Couto
Couto / terraform.rb
Last active January 18, 2019 11:01
terraform v0.10.8
require "language/go"
class Terraform < Formula
desc "Tool to build, change, and version infrastructure"
homepage "https://www.terraform.io/"
url "https://github.com/hashicorp/terraform/archive/v0.11.8.tar.gz"
sha256 "c0d7a0b726579574bcfee2ae141be4e82d1c9ab4a339cc6f86f9ec38de9130fb"
head "https://github.com/hashicorp/terraform.git"
bottle do
@Couto
Couto / main.js
Last active July 31, 2018 15:05
Demonstration of a bug in rollup-plugin-commonjs
export default (a, b) => a + b;
@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 / curry-es6.js
Last active April 12, 2018 04:13
ES5 version of curry
// curry :: (* -> a) -> (* -> a)
const curry = (fn) => function cf(...args){
return (args.length >= fn.length) ?
fn(...args) :
(...newArgs) => cf(...[...args, ...newArgs])
};