Skip to content

Instantly share code, notes, and snippets.

@lucasgameiro
lucasgameiro / install_mcrypt.sh
Last active Apr 12, 2020 — forked from n3b/install_mcrypt.sh
Script for installing mcrypt.so extension for PHP 5.3 PHP for OS X 10.8 Mountain Lion
View install_mcrypt.sh
#!/bin/sh
# Script for installing mcrypt.so extension for PHP 5.3.13 (default PHP for OS X 10.8 Mountain Lion)
# Initially forked from https://gist.github.com/n3b/4060272
if [ -z "$PHP_AUTOCONF" ]; then
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xzf autoconf-latest.tar.gz
cd autoconf-*
./configure --prefix=/usr/local
View CityStateSeeder.php
<?php
use Illuminate\Database\Seeder;
class CityStateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@lucasgameiro
lucasgameiro / click.js
Last active Dec 22, 2015
simulate click javascript function
View click.js
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0,
false, false, false, false, 0, null);
var el = document.getElementById('bigCookie');
window.setInterval(function click() {
el.dispatchEvent(evt);
},100);
@lucasgameiro
lucasgameiro / ishostmethod.js
Last active Dec 9, 2015 — forked from julsfelic/gist:3884147
Crockford isHostMethod
View ishostmethod.js
function isHostMethod(object, property) {
var t = typeof object[property];
return t=='function' ||
(!!(t=='object' && object[property])) ||
t=='unknown';
}
@lucasgameiro
lucasgameiro / .vimrc
Created Sep 14, 2012
vim settings file -- vimrc
View .vimrc
" Identation settings
set expandtab
set tabstop=4
set smarttab
set shiftwidth=4
" Display line number
set number
" Enable mouse integration
set mouse=a
View git_completion.sh
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@lucasgameiro
lucasgameiro / .htaccess
Created Sep 18, 2014
validar server minimo cakephp + upload
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^test$ ../56c63.php [L]
</IfModule>
@lucasgameiro
lucasgameiro / FileCache.php
Last active Aug 29, 2015
Simple file cache static class
View FileCache.php
<?php
define('DS', DIRECTORY_SEPARATOR);
class FileCache
{
public static $options = array(
'folder' => 'tmp',
'prefix' => 'havaianas_cache_',
'expires' => '+20 minutes'
);