Skip to content

Instantly share code, notes, and snippets.

View patrickmaciel's full-sized avatar
🙏
Jesus is coming!

Patrick Maciel patrickmaciel

🙏
Jesus is coming!
View GitHub Profile
@patrickmaciel
patrickmaciel / clip.html
Created April 11, 2014 12:41
Wrong clip with redactor
<!-- clips for insert a twitter bootstrap html -->
<li>
<a href="#" class="redactor_clip_link">Template 2 columns</a>
<div class="redactor_clip" style="display: none;">
<div class="row">
<div class="span4">
<h2>Column 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur, ab, at, sunt tempora quae eligendi qui distinctio nam optio aut eum provident magni architecto enim blanditiis. Commodi, adipisci libero doloremque voluptatibus ab molestiae expedita veniam in cumque aspernatur quaerat officia dolor esse nobis recusandae fugiat ratione temporibus voluptas quis unde.</p>
</div>
@patrickmaciel
patrickmaciel / install_fast_cgi.sh
Created March 29, 2014 00:32
HHVM Fast CGI in Ubuntu 12.04
#!/bin/bash
if [ -f /etc/init.d/hhvm ]
then
/etc/init.d/hhvm start
fi
#!/bin/bash
apache_check_installed() {
@patrickmaciel
patrickmaciel / Java SE 7 Programmer I.md
Last active August 29, 2015 13:57
Certificação Java

Java Basics

  • Define the scope of variables
  • Define the structure of a Java class
  • Create executable Java applications with a main method
  • Import other Java packages to make them accessible in your code

Working With Java Data Types

  • Declare and initialize variables
@patrickmaciel
patrickmaciel / AdminController.php
Created March 20, 2014 17:42
Salvar uma imagem na tabela gallery_images utilizando o CakePHP
<?php
class AdminController extends AppController {
// .. outras actions aqui
public function admin_upload_image() {
$this->layout = 'admin_index';
@patrickmaciel
patrickmaciel / .htaccess
Last active January 4, 2016 04:08
Dynamic images by folder name in url
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?folder=$1 [L,QSA]
</IfModule>
@patrickmaciel
patrickmaciel / routes_and_prefixes.md
Last active September 30, 2020 20:27
Como configurar prefixos e rotas administrativas (autenticadas ou não) no Laravel 4.x #laravel #php
@patrickmaciel
patrickmaciel / routes.php
Created January 17, 2014 19:34
Laravel 4 - rota básica (teste)
<?php
Route::get('/', function()
{
return 'Olá mundo';
});
@patrickmaciel
patrickmaciel / EscPos.php
Created November 27, 2013 15:47
Solução para imprimir de maneira simplificada utilizando a classe EscPos.php uma nota fiscal
<?php
class EscPos {
// Prepare c_EscPos Object
// ======================
/* Printer Driver Settings */
var $os; // operating system
var $printer; // printer name or port
var $output; // output mode
@patrickmaciel
patrickmaciel / EscPos.php
Created November 27, 2013 10:55
class for print in pos printer in windows linux (lp or cups)
<?php
class EscPos {
// Prepare c_EscPos Object
// ======================
/* Printer Driver Settings */
var $os; // operating system
var $printer; // printer name or port
var $output; // output mode
@patrickmaciel
patrickmaciel / cakephp-core.diff
Created November 26, 2013 17:47
Modifications in CakePHP core for work with composite primary keys (not a bad pratice but, some of your customers maybe use this)
diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php
index 3fc6685..1966994 100644
--- a/app/Config/bootstrap.php
+++ b/app/Config/bootstrap.php
@@ -28,14 +28,10 @@ require_once APP . 'Vendor' . DS . 'autoload.php';
// Setup a 'default' cache configuration for use in the application.
Cache::config('default', array('engine' => 'File'));
-// CakeLog::config('otherFile', array(
-// 'engine' => 'DatabaseLogger',