Skip to content

Instantly share code, notes, and snippets.

View oirodolfo's full-sized avatar
🏳️‍🌈
working from home

Rod Kisten (Costa) oirodolfo

🏳️‍🌈
working from home
View GitHub Profile
@oirodolfo
oirodolfo / laravel-mongodb-sentinel
Created February 29, 2016 19:45 — forked from Bodom78/laravel-mongodb-sentinel
Use the Sentinel 2.x authentication package with Laravel 5.1 and MongoDB
Work in Progress: More testing to be done.
At a glance Authentication, Activation, Throttle, Groups & Permissions seem to
be working.
Downside: Copy and modify files.
Upside: Not really much work to get it up and running.
Assumes you have Laravel 5.1, jenssegers/laravel-mongodb + session addon set up
and your app is namespaced to App/
@oirodolfo
oirodolfo / homestead_extras.sh
Created April 12, 2016 19:39 — forked from kuroski/homestead_extras.sh
Script for the installation of MSSQL in Laravel Homestead (read the comments)
#!/bin/bash
#Install Laravel Homestead (http://laravel.com/docs/5.0/homestead)
#ssh into Homestead "homestead ssh"
#Run the script using "sudo bash homestead_extras.sh"
#Leave all the default options sugested during the installation, and do not modify any files!!
apt-get update
#Additional Packages
apt-get install -y php5-ldap php5-mssql
@oirodolfo
oirodolfo / post-merge
Last active June 7, 2016 17:52 — 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
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@oirodolfo
oirodolfo / php-cs-fixer-pre-commit.php
Created June 16, 2016 21:12 — forked from mardix/php-cs-fixer-pre-commit.php
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@oirodolfo
oirodolfo / post-recieve
Created June 20, 2016 18:55 — forked from bgallagh3r/post-recieve
Make git run composer install/update after you push to remote server.
#!/bin/bash
DIR=$(git rev-parse --show-toplevel)
if [ -e "$DIR/composer.json" ]; then
if [ -d "$DIR/vendor" ]; then
composer install
else
composer update
fi
@oirodolfo
oirodolfo / Run in LOCAL terminal.sh
Last active June 20, 2016 19:04 — forked from jswartwood/Run in LOCAL terminal...
Automatic Git deploys on Dreamhost
# Replace any brackets with real values
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit
@oirodolfo
oirodolfo / RequireTemplate
Created June 23, 2016 17:16 — forked from grnadav/RequireTemplate
AMD style, testable templates fetcher
define([
"jquery",
"require",
"handlebars",
"util/Util",
"../../template/CompiledTemplates" // required so to load the pre-compiled templates pushed there during build
], function ($, require, Handlebars, Util, CompiledTemplates) {
/**
* Retrieve template from handlebars file.
(function(){
String.prototype.slugify = function(replace){
if( !replace ) replace = '-';
var str = this.toString().replace(/[\s\.]+/g,replace).latinize().toLowerCase().replace(new RegExp('[^a-z0-9'+replace+']','g'),replace).replace(new RegExp(replace+'+','g'),replace);
if( str.charAt(str.length-1) == replace ) str = str.substring(0,str.length-1);
return str;
}
@oirodolfo
oirodolfo / release.sh
Created July 1, 2016 18:56 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
#!/bin/bash
#
# Creates a signed and zipaligned APK from your Ionic project
#
# Place your keystore in the root of your project and name it <company>.keystore
# Use this script as following :
# $ ./release.sh [company] [version]
#
# Don't forget to gitignore your key and your compiled apks.
#
@oirodolfo
oirodolfo / curl.sh
Created July 4, 2016 19:35 — forked from minakolta/curl.sh
CURL request benchmark
curl -w '\nLookup:\t%{time_namelookup}\nConnect :\t%{time_connect}\nPreTrans:\t%{time_pretransfer}\nStartTeans:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null -s http://yourdomain.com