Skip to content

Instantly share code, notes, and snippets.

View Cosmicist's full-sized avatar
🏴

Luciano Longo Cosmicist

🏴
  • Buenos Aires, Argentina
View GitHub Profile
@mathiasverraes
mathiasverraes / max.php
Created December 9, 2014 19:40
max($list, $function) in php
<?php
// test data
class Foo {
private $a;
private $b;
function __construct($a, $b)
{
@tomgraion
tomgraion / radio.sh
Created April 21, 2015 14:11
This is a function to play radios from a txt in mplayer in Linux.
function radio (){
mplayer `cat radios.txt | grep "$1" | grep -o 'http.*$' `
}
@robertsosinski
robertsosinski / .gvimrc
Created January 18, 2010 15:09
MacVim config file
syntax on
"font
color github
set cursorline
set guifont=Monaco:h12
set guioptions-=T
set linespace=1
set vb
@greydnls
greydnls / specification.tpl
Created September 4, 2015 14:30
PHPSpec template php5
<?php
namespace %namespace%;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class %name% extends ObjectBehavior
{
function it_is_initializable()
@bugwelle
bugwelle / angularjs-i18next-directive.js
Last active December 15, 2015 09:39
This is a simple directive for AngularJS to use i18next.
/*
*
* There is now an Angular directive, filter and provider!
* It can be found here: https://github.com/i18next/ng-i18next
* ng-i18next is now part of the i18next rganization!
*
*/
/*
* AngularJS directive for using i18next (http://jamuhl.github.com/i18next)
<?php
class BaseController extends Controller {
private $application_name = 'The Cool Kid';
protected $layout = 'base';
// The cool kids' way of handling page titles.
protected $title = array(
'parent' => '',
'seperator' => '::',
@asakurayoh
asakurayoh / Builder.php
Created November 17, 2012 22:38
Single Table Inheritance in Laravel 4 / Illuminate
<?php namespace App;
use Illuminate\Database\Eloquent\Builder as BaseBuilder;
class Builder extends BaseBuilder{
/**
* Override getModels so it send attributes to the newInstance methods (in newExisting)
*/
public function getModels($columns = array('*'))
@xsist10
xsist10 / Dispatch1.php
Last active January 21, 2017 17:28
An event dispatcher in a tweet
<?php
// Version 1
// Minified
// class Dispatch{function add($e,$l){$this->l[$e][]=$l;}function trigger($e,$d){foreach ($this->l[$e] as $l)call_user_func_array($l, $d);}}
class Dispatch{
function add($e, $l) {
$this->l[$e][] = $l;
@fideloper
fideloper / SlackOAuthController.php
Last active February 17, 2017 22:57
Slack oAuth2.0 Round Trip
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use GuzzleHttp\Client;
/*
|--------------------------------------------------------------------------
| Delete form macro
|--------------------------------------------------------------------------
|
| This macro creates a form with only a submit button.
| We'll use it to generate forms that will post to a certain url with the DELETE method,
| following REST principles.
|
*/