This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Common\DataFixtures\Executor\ORMExecutor; | |
use Doctrine\Common\DataFixtures\Purger\ORMPurger; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader as Loader; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import urllib2 | |
import json | |
request = urllib2.urlopen('https://api.github.com/repos/composer/composer/git/refs/heads/master') | |
obj = json.load(request) | |
print obj["object"]["sha"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Determine if a brew is installed. | |
# | |
# @uses brew | |
# @param string brew name | |
# @returns success code | |
# | |
function brew_installed() { | |
local brew="${1}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Starting Sublime Text from inside a Virtual Machine | |
# @link https://gist.github.com/lavoiesl/c01b16b5f875906a6d82 | |
# You may require to install realpath | |
path="$(realpath "$1")" | |
if echo "${path}" | grep -q "^/media/data/projects"; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# @link https://gist.github.com/lavoiesl/eac60efde00c1df49c73 | |
function usage() { | |
echo "Homebrew manager" | |
echo "Use dump-merge to save a list of installed brews to Dropbox" | |
echo "Use install to install missing brews" | |
echo "Usage: ${0} [--cask] [--directory directory] [--hostname hostname] dump|merge|dump-merge|diff|install" >&2 | |
exit 255 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Drop all tables of a MySQL database | |
# https://gist.github.com/lavoiesl/96aa8586b609daac2dad | |
if [ -z "$@" ]; then | |
echo "Usage: $0 database_name" >&2 | |
echo " or : $0 -uuser -ppassword -hlocalhost database_name" >&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
# https://pushover.net/ CLI tool | |
# | |
# @license MIT | |
# @author http://blog.lavoie.sl/ | |
# @link https://gist.github.com/lavoiesl/e0d1d9173e25bccb63a3 | |
# | |
# Supports APP bookmarks, example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Convert file from iso-8859-* to UTF8 if needed | |
# | |
# @link https://gist.github.com/lavoiesl/432827990d78c3764f50 | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: $0 input-file" >&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Converts an image in a multi-resolution favicon | |
# Requires Imagemagick | |
# | |
# @link https://gist.github.com/lavoiesl/a7ccb4affe869d0a0bca | |
if [[ "$#" != "2" ]]; then | |
echo "Usage: $0 input.png output.ico" >&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# OSX script to fire up a SSH connection and tunnel all traffic to it using a SOCKS proxy. | |
# @link https://gist.github.com/lavoiesl/3bd6a07af04a7979a814 | |
# | |
# Features: | |
# - Network detection (wi-fi/Ethernet) | |
# - SSH crash detection | |
# - Graceful interrupt | |
# - Automatic proxy deconfiguration |