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 / 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 / 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 / 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 / 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 / NotificationsController.php
Created April 11, 2014 15:45
Envio de e-mails com CakePHP (exemplo prático)
<?php
App::uses('AppController', 'Controller');
/**
* Notifications Controller
*
* @property Notification $Notification
*/
class NotificationsController extends AppController {
@patrickmaciel
patrickmaciel / 000-default.conf
Last active August 29, 2015 14:01
Instalando última versão do Apache e PHP no Ubuntu 14.04
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" " alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
"
" " let Vundle manage Vundle, required
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
@patrickmaciel
patrickmaciel / ataques.rb
Created July 26, 2014 15:22
Blog - Aprendendo Ruby - Modules
# encoding utf-8
module Ataques
def ataqueEspecial
puts "Ataque especial #{fraseDeImpacto}"
end
end
@patrickmaciel
patrickmaciel / .xinitrc
Created July 28, 2014 03:00
Openbox, compton and Catalyst-hoook slowly in Arch Linux
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done