Skip to content

Instantly share code, notes, and snippets.

View gnclmorais's full-sized avatar
🐙
Growing a beard

Gonçalo Morais gnclmorais

🐙
Growing a beard
View GitHub Profile
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;
} );
@gnclmorais
gnclmorais / hack.sh
Created November 21, 2013 12:34 — forked from linssen/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
#
@gnclmorais
gnclmorais / type.js
Created December 3, 2013 15:19 — forked from jonbretman/type.js
(function (root) {
var type = function (o) {
// handle null in old IE
if (o === null) {
return 'null';
}
// handle DOM elements
@gnclmorais
gnclmorais / mov2gif.md
Last active February 9, 2016 10:48
OS X Screencast to animated GIF

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

/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@gnclmorais
gnclmorais / gifify.sh
Created June 13, 2014 17:17
Concatenates a bunch of sequencial pictures into a transitional .gif file
#!/bin/sh
#
# Grabs all .png files in a folder and concatenates them into a .gif file
#
# Options:
# -delay Delay between images in centisecond
convert -delay 75 *.png result.gif
@gnclmorais
gnclmorais / iterm2_toggle.sh
Created July 27, 2014 11:18
Add/remove iTerm 2 from OS X’s dock
#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
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
@gnclmorais
gnclmorais / README.md
Last active August 29, 2015 14:07 — forked from addyosmani/README.md

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

// Set up line-height and colour defaults for this mixin.
$line-height: 20px!default;
$line-color: #94d4ff!default;
/**
*
* Baseline Mixin
* Handy dandy mixin to provide a baseline for your typography.
*
* The mixin carries two arguments — the $baseline, which should match your line-height, and $baseline-color, the colour you want the lines to be.