Skip to content

Instantly share code, notes, and snippets.

View sahibalejandro's full-sized avatar
😎
Doing cool stuff!

Sahib sahibalejandro

😎
Doing cool stuff!
View GitHub Profile
@sahibalejandro
sahibalejandro / vagrant.sh
Last active August 29, 2015 14:01
vagrant machine provisioning, Apache 2.2 + PHP 5.3.20
#!/usr/bin/env bash
# Instalacion de paquetes necesarios
apt-get update
apt-get install -y build-essential autoconf libxml2-dev libmcrypt-dev libmysqlclient-dev openssl pkg-config libjpeg-dev libpng-dev libxslt1-dev libcurl4-gnutls-dev libbz2-dev libxpm-dev libfreetype6-dev
apt-get install -y curl
mkdir /home/vagrant/provisioning
cd /home/vagrant/provisioning
@sahibalejandro
sahibalejandro / Vagrantfile
Created June 21, 2014 06:21
Vagrant default configuration
config.vm.box = "hashicorp/precise64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell", path: "vagrant-provision.sh"
config.vm.hostname = "vagrant"
@sahibalejandro
sahibalejandro / vagrant-provision.sh
Last active August 29, 2015 14:02
Vagrant provision script
#!/usr/bin/env bash
# Install basics
apt-get update
apt-get -y install git curl python-software-properties
# Install packagess
add-apt-repository -y ppa:ondrej/php5
apt-get update
apt-get -y install php5 php5-mysql php5-mcrypt php5-curl php5-gd
@sahibalejandro
sahibalejandro / laravel-stack.sh
Last active August 29, 2015 14:04
Create Laravel development environment
#!/bin/bash
# Create laravel project
composer create-project laravel/laravel .
# Download vagrant-provision.sh
curl https://gist.githubusercontent.com/sahibalejandro/80038293f363ec9c95c2/raw/b78a4682f70a3125b96a2dc508a9914472bff5c2/vagrant-provision.sh > vagrant-provision.sh
# Initialize and configure Vagrantfile
vagrant init -m
@sahibalejandro
sahibalejandro / aliases
Created August 5, 2014 16:36
My aliases file
export PATH=$PATH:/usr/local/mysql/bin:/Users/sahib/bin
#
# Vagrant commands
#
alias vi="vagrant init"
alias vu="vagrant up"
alias vh="vagrant halt"
alias vd="vagrant destroy"
@sahibalejandro
sahibalejandro / timelapse.sh
Last active November 24, 2015 18:22
Create timelapse video with ffmpeg
ffmpeg -f image2 -start_number 170 -i G0010%03d.JPG -s 750x562 -pix_fmt yuv420p -r 60 tiendeme.mov
@sahibalejandro
sahibalejandro / default-date-datepicker
Last active August 29, 2015 14:06
Setup defaultDate from altField on jQuery UI datepickers.
/**
* Setup datepickers
*/
$('.datepicker').each(function ()
{
var alt_field = $(this).data('alt-field');
var altField = $(alt_field);
var defaultDate = new Date();
if (altField.val() != '') {
@sahibalejandro
sahibalejandro / InputValidator
Last active August 29, 2015 14:06
Class InputValidator
<?php namespace Acme\Validators;
use Validator;
/**
* Class InputValidator
* @package Acme\Validators
*/
abstract class InputValidator {
@sahibalejandro
sahibalejandro / InputValidatorException
Created September 3, 2014 22:36
Class InputValidatorException
<?php namespace Acme\Validators;
use Illuminate\Support\MessageBag;
/**
* Class InputValidatorException
* @package Acme\Validators
*/
class InputValidatorException extends \Exception {
@sahibalejandro
sahibalejandro / Gruntfile.js
Created September 5, 2014 14:28
Grunt example
module.exports = function (grunt)
{
var files = {
vendor: {
css_src: 'vendor/css/bootstrap.css',
css_dest: 'compiled/vendor.min.css',
js_src: ['vendor/js/jquery.js', 'vendor/js/bootstrap.js'],
js_dest: 'compiled/vendor.min.js'
},
app: {