Skip to content

Instantly share code, notes, and snippets.

🐙
Growing a beard

Gonçalo Morais gnclmorais

🐙
Growing a beard
Block or report user

Report or block gnclmorais

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gnclmorais
gnclmorais / c-cedilla.md
Last active Jun 12, 2018
How to write the letter ç (c-cedilla) in virtually everywhere.
View c-cedilla.md
Character OS X (UK) Unicode Alt Code HTML (Name) HTML (Number)
Upper case Ç + + c U+00C7 Alt 0199 Ç Ç
Lower case ç + c U+00E7 Alt 0231 ç ç

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).


More info @ Wikipedia.

@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 / iterm2_toggle.sh
Created Jul 27, 2014
Add/remove iTerm 2 from OS X’s dock
View iterm2_toggle.sh
#Remove iTerm 2 from the dock
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm\ 2.app/Contents/Info.plist
#Restore iTerm 2 to the dock
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm\ 2.app/Contents/Info.plist
@gnclmorais
gnclmorais / mov2gif.md
Last active Feb 9, 2016
OS X Screencast to animated GIF
View mov2gif.md

Overview

Following this gist, I decided to create my own tutorial/manual for future reference.

Prerequisites

Before trying to convert anything, you must have the following tools installed:

  • QuickTime (to record the video)
  • ffmpeg (to process the video file)
  • gifsicle (to create and optimise the animated gif)

Instalation

View type.js
(function (root) {
var type = function (o) {
// handle null in old IE
if (o === null) {
return 'null';
}
// handle DOM elements
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/4016420/hack.sh | sh
#
View detailedMetrics.js
javascript:( function() {
console.group( 'Performance Information for all entries of ' + window.location.href );
console.log( '\n-> Duration is displayed in ms\n ' )
var entries = window.performance.getEntries();
entries = entries.sort( function( a, b ) {
return b.duration - a.duration;
} );
View detailedMetrics.js
javascript:( function() {
console.group( 'Performance Information for all entries of ' + window.location.href );
console.log( '\n-> Duration is displayed in ms\n ' )
var entries = window.performance.getEntries();
entries = entries.sort( function( a, b ) {
return b.duration - a.duration;
} );
You can’t perform that action at this time.