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
View .zshrc
# for golang
# mkdir $HOME/go
# mkdir -p $GOPATH/src/github.com/user
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
@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 / gifify.sh
Created Jun 13, 2014
Concatenates a bunch of sequencial pictures into a transitional .gif file
View gifify.sh
#!/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
View high-dpi-media.css
/* ---------------------------------------------------------- */
/* */
/* 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 / 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;
} );
View gist:5965486
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
You can’t perform that action at this time.