Skip to content

Instantly share code, notes, and snippets.

View couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto couto

👽
Did you raid area 51?
View GitHub Profile
# Install vim and mamp
brew install vim
brew cask install mamp
# Open MAMP and set default ports, don't start the server yet
# Also choose a better DocumentRoot like ~/Development or ~/Sites
open /Applications/MAMP/MAMP.app
# Enable virtual-hosts in Apache's configuration
vim /Applications/MAMP/conf/apache/httpd.conf
@couto
couto / SSL_cert_creation.sh
Last active January 2, 2016 02:39
Create random SSL certificates for use in development.
# Generate SSL Certificate for dev
export DOMAIN="example.dev"
export PASSPHRASE=$(head -c 500 /dev/urandom | tr -dc a-z0-9A-Z | head -c 128; echo)
export SUBJ="
C=PT
ST=Aveiro
O=Example Organization
localityName=Aveiro
commonName=$DOMAIN

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

@couto
couto / fixsvn.sh
Last active June 17, 2016 10:37 — forked from siddhadev/gist:5814802
Fix the svn "Working copy text base is corrupt" error.
#!/bin/bash
set -e
usage(){
echo "Error $errcode $errorcode at line ${BASH_LINENO[0]} while executing: $BASH_COMMAND"
exit $errorcode
}
trap usage ERR
@couto
couto / parameters.js
Created December 5, 2013 16:25
Get arguments names function
/**
* parameters
* Given a function, it will return the name of that function's arguments
*
* @param {Function}
* @returns {Array}
* @example
* var example = function (a, b) {};
* parameters(example) // ['a', 'b']
*
@couto
couto / bind.js
Created December 3, 2013 12:04
Simplest bind function
/**
* 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}
*/
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s http://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'

First, install dnsmasq using brew:

$ brew update
$ brew install dnsmasq

Then create your configuration

Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.hostname = "musicbrainzvm"
config.vm.provider :vmware_fusion do |v, override|
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
override.vm.box = "precise64_vmware.box"
end
/*jshint node:true*/
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
files: {
http : '/',
html: '../application/views',
css : 'stylesheets',