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 / git_clone_error
Created October 5, 2012 13:41
try cloning github repository without commits
> git clone -b master --single-branch --depth 1 [email protected]:patrickmaciel/git-essential.git
error: unknown option `single-branch'
usage: git clone [options] [--] <repo> [<dir>]
> git archive --remote git://github.com/patrickmaciel/git-essential.git master | tar -xvf - -C .
fatal: remote error:
Your Git client has made an invalid request:
0048git-upload-archive /patrickmaciel/git-essential.git
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
@patrickmaciel
patrickmaciel / steam_open_games.sh
Created November 12, 2012 17:21
steam open games log
> primusrun steam steam://open/games
Installing breakpad exception handler for appid(steam)/version(1352503901_client)
Xlib: extension "NV-GLX" missing on display ":0".
main.cpp (423) : Assertion Failed: Looks like steam didn't shutdown cleanly, scheduling immediate update check
Assert( Assertion Failed: Looks like steam didn't shutdown cleanly, scheduling immediate update check ):/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/steamexe/./main.cpp:423
unlinked 0 orphaned pipes
removing stale semaphore last operated on by process 4898 with name 0eBlobRegistryMutex_9A400D9386B895718080557C598EBA86
removing stale semaphore last operated on by process 4898 with name 0eBlobRegistrySignal_9A400D9386B895718080557C598EBA86
removing stale semaphore last operated on by process 4898 with name 0emSteamEngineInstance
@patrickmaciel
patrickmaciel / query with recursive sub select.sql
Created January 12, 2013 19:34
Recursive select with conditions
CREATE DATABASE teste001;
USE teste001;
CREATE TABLE invoices (invoice not null serial, add_date datetime);
INSERT INTO invoices VALUES
(1, '2010-01-21 00:00:00.000'),
(2, '2010-02-11 00:00:00.000'),
(3, '2010-01-30 00:00:00.000'),
(4, '2010-03-11 00:00:00.000'),
(5, '2010-04-21 00:00:00.000'),
@patrickmaciel
patrickmaciel / BaseController.php
Created January 25, 2013 00:35
Route with namespace in Laravel 4 - ERROR: Whoops, looks like something went wrong. FatalErrorException: Error: Class 'PatrickMaciel\Admin\BaseController' not found in /home/..../app/controllers/admin/ProjectsController.php line 3
<?php namespace PatrickMaciel;
class BaseController extends Controller {
/**
* Setup the layout used by the controller.
*
* @return void
*/
protected function setupLayout()
@patrickmaciel
patrickmaciel / index.php
Created May 5, 2013 22:33
Tentando conectar no Facebook SDK PHP
<?php
/**
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@patrickmaciel
patrickmaciel / gist:6224655
Created August 13, 2013 19:17
Apache 2.2.6 crash with this error in PHP 5.4.17
<?php
foreach ($teams as $team_key => $team) {
$table_employees[$team_key] = array();
$table_employees[$team_key]['team'] = $team_key;
$table_employees[$team_key]['employees'] = array();
foreach ($team as $employee) {
$table_employees[$team_key]['employees'][$employee['id']]['id'] = $employee['id'];
$table_employees[$team_key]['employees'][$employee['id']]['name'] = $employee['name'];
@patrickmaciel
patrickmaciel / close.ctp
Created August 19, 2013 16:56
Try to resize input and add-ons like buttons in Twitter Bootstrap 2.3.2
<?php
<span class="input-prepend input-append">
<span class="add-on">'$</span>
<?php echo $this->Form->input(amount', array('div' => false, 'type' => 'text', 'label' => false, 'class' => 'money input-mini')) ?>
<button type='submit' class="btn btn-small btn-success" title='Send'><i class="icon-ok icon-white"></i></button>
<button type='button' class="btn btn-small btn-danger cancel-adjustment" title='Cancel'><i class="icon-ban-circle icon-white"></i></button>
</span>
@patrickmaciel
patrickmaciel / edit.blade.php
Created September 5, 2013 03:40
form - 1970
@extends('layouts.admin')
@section('content')
<div class="row-fluid">
<div class="col-lg-2">
<ul class="nav nav-pills nav-stacked">
<li class='active'>{{ HTML::linkRoute('admin.registration_period.destroy', 'Excluir', $registration_period->id) }}</li>
<li>{{ HTML::linkRoute('admin.registration_period', 'Listar Período de Inscrições') }}</li>
</ul>
</div>
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function postUpdate($id)
{
$registration_period = \RegistrationPeriod::find($id);
if ($registration_period != null) {
@patrickmaciel
patrickmaciel / oh-my-zsh.sh
Created September 23, 2013 00:17
Warning when I was installing Rails 4.0 in Ubuntu 12.04 x64
unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/belongs_to.png, skipping
unable to convert "\xF4" from ASCII-8BIT to UTF-8 for guides/assets/images/book_icon.gif, skipping
unable to convert "\x91" from ASCII-8BIT to UTF-8 for guides/assets/images/bullet.gif, skipping
unable to convert "\xF5" from ASCII-8BIT to UTF-8 for guides/assets/images/chapters_icon.gif, skipping
unable to convert "\xF5" from ASCII-8BIT to UTF-8 for guides/assets/images/check_bullet.gif, skipping
unable to convert "\xF4" from ASCII-8BIT to UTF-8 for guides/assets/images/credits_pic_blank.gif, skipping
unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/csrf.png, skipping
unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/edge_badge.png, skipping
unable to convert "\x9E" from ASCII-8BIT to UTF-8 for guides/assets/images/favicon.ico, skipping
unable to convert "\x80" from ASCII-8BIT to UTF-8 for guides/assets/images/feature_tile.gif, skipping