Skip to content

Instantly share code, notes, and snippets.

View wallacemaxters's full-sized avatar

Wallace Maxters wallacemaxters

View GitHub Profile
@wallacemaxters
wallacemaxters / CommandContainer.php
Last active August 1, 2016 17:27
Simple Command Line Container class
<?php
class CommandContainer
{
protected $commands = [];
public function define($name, \Closure $closure)
{
$this->commands[$name] = $closure->bindTo($this);
}
@wallacemaxters
wallacemaxters / deploy.php
Created June 7, 2016 11:42
Exemplo de deploy usando o PHP Deploy no Laravel
<?php
include 'recipe/common.php';
task('git:pull', function () {
run('git pull');
})->desc('Faz o GIT-PULL trazendo as últimas alterações');
@wallacemaxters
wallacemaxters / global.php
Last active May 18, 2016 13:18
Sistema de envio de relatório/log de erro com e-mail no Laravel 4
<?php
// Substituir `App::error` pelo código abaixo:
App::error(function (Exception $exception, $code) {
// Se a aplicação estiver no "local" ou erro for "página não encontrada", não envia
if ($code === 404 || App::isLocal()) return;
//Log::error($exception);
@wallacemaxters
wallacemaxters / superanimes_remove_ad.js
Last active April 29, 2016 04:02
Remove bloqueador de anúncios do Superanimes. (Utilizar com o TampeyMonkey)
// ==UserScript==
// @name Superanimes
// @namespace com.wallacemaxters
// @version 0.1
// @description Removendo algumas coisas do Superanimes
// @author Wallace de Souza
// @match http://www.superanimes.com/*
// @grant none
// @run-at document-start
// @require http://code.jquery.com/jquery-latest.js
@wallacemaxters
wallacemaxters / RouterSeeder.php
Last active April 26, 2016 13:25
Um Seeder para poder inserir todas as rotas (de controllers) no Laravel 4
<?php
use Illuminate\Routing\ControllerInspector;
class RoutesSeeder extends Seeder
{
public function run()
{
$me = $this;
@if(auth()->user()->canAccessByName($route))
<p class="text-right">{!! link_to_route($route, 'adicionar', null, ['class'=>'btn btn-primary']); !!}</p>
@endif
<?xml version="1.0" encoding="utf-8"?>
<!--
Web.config file for Test.
The settings that can be used in this file are documented at
http://www.mono-project.com/Config_system.web and
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
<configSections>
<?php
function async_request($method, $url, $params, array $headers = [])
{
$method = strtoupper($method);
$data = http_build_query($params);
$parts = parse_url($url) + [
@wallacemaxters
wallacemaxters / file_to_base64.py
Last active January 7, 2016 17:35
Pequeno script em python para converter arquivo para base64
#-*- coding: utf-8 -*-
from base64 import b64encode
print "Digite o nome/caminho do arquivo que deseja abrir: \n"
read_filename = raw_input();
with open(read_filename, 'rb') as file:
base64_contents = b64encode(file.read())
@wallacemaxters
wallacemaxters / jquery-animated-text.js
Created December 4, 2015 16:38
Animated text in jquery
(function ( $ ) {
$.fn.animatedText = function (first_param, options) {
var $self = $(this);
$self.attr('in-animation-text', 'true');
if ($.isPlainObject(first_param)) {