Skip to content

Instantly share code, notes, and snippets.

@lucasff
lucasff / .bashrc
Last active August 29, 2015 13:56
my Ubuntu prompt
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@lucasff
lucasff / rdio
Created February 14, 2014 16:01
Scripts for Keyboard Shortcuts of Rdio under Ubuntu (maybe Mint and Debian too) Linux
google-chrome --app=http://rdio.com
@lucasff
lucasff / home.ctp
Created March 1, 2014 18:03
home.ctp Page CakePHP 2.4.5 with Bootstrap 3.1.1
<?php
/**
*
*
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Pages
* @since CakePHP(tm) v 0.10.0.1076
*/
if (!Configure::read('debug')):
@lucasff
lucasff / SVN.md
Last active August 29, 2015 13:57
Subversion

Subversion

  1. Setando o PuTTY no PATH: a. set PATH=C:\Program Files (x86)\PuTTY;%PATH%
  2. Definindo o path para o plink.exe a. Ir até a janela de variáveis de ambiente (Environmnt Variables) b. Criar o novo valor com os seguintes dados: i. SVN_SSH: C:\Program Files (x86)\PuTTY\plink.exe
  3. Para criar um túnel no PuTTY a. Definir no menu tunnels a porta local (primeiro campo) e,
@lucasff
lucasff / sqlyog_password_deobfuscator.php
Created May 23, 2014 19:58
SQLyog stored password deobfuscator
<?php
function deobfuscate($char) {
$b = ord($char);
$first = ($b << 1) & 0xFF;
$second = ($b >> (8 - 1));
return chr($first | $second);
}
$encoded = 'OZm7mTGYGZk=';
@lucasff
lucasff / sql2utf8.php
Created May 27, 2014 23:12
Convert MySQL data to UTF8
<?php
function MysqlError()
{
if (mysql_errno())
{
echo "<b>Mysql Error: " . mysql_error() . "</b>\n";
}
}
@lucasff
lucasff / php5.fcgi
Created May 30, 2014 20:18
Virtualmin PHP5 CGI script wrapper
#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php5-cgi
@lucasff
lucasff / SslComponent.php
Created June 23, 2014 16:28
SSL Component for CakePHP 1.3
<?php
class SslComponent extends Object
{
var $components = array('RequestHandler');
var $Controller = null;
function initialize(&$Controller)
{
@lucasff
lucasff / ParcelamentoHelper.php
Created June 23, 2014 19:49
Cálculo de Parcelamento para CakePHP 1.3
<?php
class ParcelamentoHelper extends AppHelper
{
//var $helpers = array('String');
var $coef = array(4 => 1.02490,
5 => 1.03750,
6 => 1.05019,
7 => 1.06300,
@lucasff
lucasff / paths.php
Last active August 29, 2015 14:02
CakePHP params on JavaScript
<?php
/** @var View $this */
$paths = array();
$paths['sid'] = $this->Session->id();
$paths['domain'] = $_SERVER['SERVER_NAME'];
$paths['basename'] = $this->base;
$paths['basePath'] = Router::url('/');
$paths['controller'] = $this->params['controller'];