Skip to content

Instantly share code, notes, and snippets.

@lucasgameiro
lucasgameiro / install_mcrypt.sh
Last active April 12, 2020 18:57 — forked from n3b/install_mcrypt.sh
Script for installing mcrypt.so extension for PHP 5.3 PHP for OS X 10.8 Mountain Lion
#!/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
<?php
use Illuminate\Database\Seeder;
class CityStateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@lucasgameiro
lucasgameiro / click.js
Last active December 22, 2015 05:18
simulate click javascript function
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 December 9, 2015 19:58 — forked from julsfelic/gist:3884147
Crockford isHostMethod
function isHostMethod(object, property) {
var t = typeof object[property];
return t=='function' ||
(!!(t=='object' && object[property])) ||
t=='unknown';
}
@lucasgameiro
lucasgameiro / .vimrc
Created September 14, 2012 15:11
vim settings file -- vimrc
" Identation settings
set expandtab
set tabstop=4
set smarttab
set shiftwidth=4
" Display line number
set number
" Enable mouse integration
set mouse=a
#
# 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 September 18, 2014 22:37
validar server minimo cakephp + upload
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^test$ ../56c63.php [L]
</IfModule>
@lucasgameiro
lucasgameiro / FileCache.php
Last active August 29, 2015 14:05
Simple file cache static class
<?php
define('DS', DIRECTORY_SEPARATOR);
class FileCache
{
public static $options = array(
'folder' => 'tmp',
'prefix' => 'havaianas_cache_',
'expires' => '+20 minutes'
);