Skip to content

Instantly share code, notes, and snippets.

View juanigaray's full-sized avatar

Juani Garay juanigaray

  • Buenos Aires, Argentina
View GitHub Profile
@juanigaray
juanigaray / good_old_reddit_v2.js
Last active June 19, 2024 16:21
Good ol' Reddit v2
// ==UserScript==
// @name Good o'l Reddit
// @description Makes sure you're using Good o'l Reddit. (C) TheNH813 2018, additions by Chana G. License WTFPLV2
// @version 1.0
// @match *://*.reddit.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
// old.reddit.com doesn't work on media
gource -1024x576 --key --output-framerate 60 --bloom-multiplier 0.2 --seconds-per-day 0.6 --auto-skip-seconds 0.5 --highlight-users --highlight-colour ff0000 --hide filenames --date-format "%#d/%#m/%Y" --dir-name-depth 3 -o gource.ppm
/* To be used with Deno as a CLI utility
* Trasposes a note a given number of semitones
* E.G: `deno transpose.ts D# 15`
* -> E
*/
const notes = [
"A",
"Bb",
"B",
@juanigaray
juanigaray / line_spacing.scss
Created August 14, 2020 19:38
Line spacing in Sass css
/* The line-height value doesn't only define the distance between different lines
* but also distances the lines from everything around them.
* This mixin allows one to distance lines in a text while keeping the distance between a
* text and its surrounding elements constant.
* Assumes $line-height >= 1
*/
@mixin line-spacing($line-height: 1) {
line-height: $line-height;
// Negative margin to compensate for line-height pushing the first line downward / the last line upward
$compensation-margin: ($line-height - 1) / -2;
@juanigaray
juanigaray / setNestedValueInLodash.js
Created April 6, 2020 15:50
Lodash set nested value in array
// You can test this here: https://codepen.io/travist/full/jrBjBz/
var users = [
{ user: 'barney', age: 36, active: true },
{ user: 'fred', age: 40, active: false },
{ user: 'travis', age: 37, active: true}
];
result = _.set(users, "0.user", "asd");