Skip to content

Instantly share code, notes, and snippets.

Avatar
🐙
Growing a beard

Gonçalo Morais gnclmorais

🐙
Growing a beard
View GitHub Profile
@gnclmorais
gnclmorais / components.my-checkbox\.js
Last active Apr 8, 2022
Checkbox with multiple args
View components.my-checkbox\.js
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class extends Component {
@action
selectProduct({ id, checked }) {
console.log({ id, checked });
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am gnclmorais on github.
  • I am gnclmorais (https://keybase.io/gnclmorais) on keybase.
  • I have a public key ASCSdjucny8qcjDql7Lcw91lxP6wl4E07jCdw1jIEG7hYgo

To claim this, I am signing this object:

@gnclmorais
gnclmorais / flatter.js
Last active Aug 29, 2017
Iterate over a matrix in JavaScript, cell by cell
View flatter.js
function* flatten(matrix) {
for (var i = 0; i < matrix.length; i += 1) {
let column = matrix[i];
if (!Array.isArray(column)) yield column;
for (var j = 0; j < column.length; j += 1) {
yield column[j];
}
}
@gnclmorais
gnclmorais / 80_char_limit.commented.css
Last active Jul 5, 2017
CSS-only ruler for GitHub diff
View 80_char_limit.commented.css
.code-review::after {
/** Make the pseudo-element visible: */
content: '';
/** Replicate the font style the <td> element is using: */
font-size: 12px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
/** Replicate the left padding the <td> element has: */
margin-left: 10px;
/** Setup actual positioning of the element: */
position: absolute;
@gnclmorais
gnclmorais / readme.md
Created Dec 20, 2015 — forked from maxogden/readme.md
Video stabilization using VidStab and FFMPEG (Mac OS X)
View readme.md

Video stabilization using VidStab and FFMPEG

Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.

Install ffmpeg with the vidstab plugin from homebrew

brew install ffmpeg --with-libvidstab
View osx-10-10-virtualbox.md

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

@gnclmorais
gnclmorais / c-cedilla.md
Last active Feb 17, 2022
How to write the letter ç (c-cedilla) in virtually everywhere.
View c-cedilla.md

Writing cursive forms of Ç, from Wikipedia

Character macOS (UK) Unicode Alt Code HTML (Name) HTML (Number)
Upper case Ç + + c U+00C7 Alt 0199 &Ccedil; &#199;
Lower case ç + c U+00E7 Alt 0231 &ccedil; &#231;

On Linux, you can use Ctrl + Shift + u followed by the code in hex/unicode (you only need to hold down Ctrl and Shift while typing the code).


View bind.js
/**
* bind
* Takes a function and returns a new one that will always have a particular context.
* If arguments are given, curry will happen: http://ejohn.org/blog/partial-functions-in-javascript/
*
* @param {Function} fn Function whose context will be changed
* @param {Object} [ctx=this] the obejct to which the context will be set
* @param {Mixed} [args...] Arguments to be passed to the resulting function
* @returns {Function}
*/
View readme.md

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser