Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile

Setup Mac OS X Mountain Lion

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first time I needed to reinstall everything, maybe the next time...

var reporterInterface = (function() {
function start( data ) {
/** PROCESS DATA **/
output( "TAP version 13" );
}
function suiteStart( data ) {
/** PROCESS DATA **/
var resp = comment( data.name + " suite" );

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@leobalter
leobalter / pave.md
Last active August 29, 2015 14:05 — forked from juanplopes/pave.md

Texto criado pelo amigo Carlos Krämer (github . twitter . facebook) lá no Facebook, reproduzido aqui com a permissão dele.

Jornalista: Candidato, é pavê ou pra comê?

Dilma: Veja bem, nunca foi tanto pra comê quanto no meu governo. Há um ditado.... eu digo, editaram quando eu era o cachorro atrás de uma criança ... que diz que todo mundo que insere, ou melhor, ingere o que é pavê, tem uma satisfação imensa de... como dizem... dobrar a esquina. Mas nós precisamos continuar mudando, meu governo foi ótimo, eu fui eleita para dar prosseguimento ao governo Lula, Lula, LULA. Mas ninguém está mais insatisfeita com ele, digo, com o governo, não com o Lula, do que eu, mas os pessimistas é que estão tornando tudo ruim.

Marina: Eu não acho que é pavê nem pra comê. Nós precisamos aprender a reunir o que é bom em tudo, as melhores

QUnit.suite('jQuery Core', function (assert, test) {
test.beforeEach(function (assert) {
var env = this,
done = assert.async();
this.user = 'data';
setTimeout(function () {
env.foo = 'bar';

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.
@leobalter
leobalter / _css_dropdown_menu.markdown
Last active August 29, 2015 14:21 — forked from anonymous/index.html
CSS Dropdown Menu

CSS Dropdown Menu

('-' * 6)

A Pen by Leo Balter on CodePen.

License

Copyright (c) 2015 by Leonardo Balter
@leobalter
leobalter / karma.conf.js
Created November 12, 2015 23:01 — forked from frederickfogerty/karma.conf.js
Coverage + tests with webpack, babel, karma, mocha, and istanbul
var webpack = require('webpack')
module.exports = function (config) {
config.set({
browsers: [ 'Chrome' ], //run in Chrome
browserNoActivityTimeout: 60000,
singleRun: true, //just run once by default
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
//'src/**/*.{jsx,js}',
@leobalter
leobalter / post-merge
Created March 15, 2016 18:44 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@leobalter
leobalter / git-gpg.md
Created June 16, 2016 16:33 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf