Skip to content

Instantly share code, notes, and snippets.

View fedeisas's full-sized avatar
🎯

Fede Isas fedeisas

🎯
  • Buenos Aires, Argentina
View GitHub Profile
@fedeisas
fedeisas / gist:1998044
Created March 8, 2012 02:05
ImageMagick-fu reminder
/* SOURCE URL */
http://www.printableworldflags.com/flag-icon
/* CREATE TRANSPARENT FILL 32x32 */
convert -size 32x32 xc:transparent -fill 'rgba(180, 180, 180, 0.8)' -draw 'rectangle 0,0 32,32' trans.png
/* CREATE SEMI-TRANS IMAGE (mix flag.png & trans.png) */
composite -dissolve 50% flag.png trans.png hover_flag.png
@fedeisas
fedeisas / azure-worker.php
Created March 28, 2013 03:56
Azure Worker example
<?php
use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
Class Worker_Task {
public $queueRestProxy;
public $servicesBuilder;
@fedeisas
fedeisas / SocketWrapper.php
Created April 7, 2013 16:20
HTTP/Request2/SocketWrapper.php
<?php
/**
* Socket wrapper class used by Socket Adapter
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2008-2012, Alexey Borzov <avb@php.net>
* All rights reserved.
<?php namespace MyApp;
class Mailer extends \Illuminate\Mail\Mailer {
/**
* Render the given view.
*
* @param string $view
* @param array $data
* @return \Illuminate\View\View
@fedeisas
fedeisas / gist:5862227
Last active December 18, 2015 23:29
Inline CSS Styles on Laravel 4
<?php
/* 1. Add the dependency to your composer.json.
// I'm using https://packagist.org/packages/tijsverkoyen/css-to-inline-styles
*/
/* 2. Extend \Illuminate\Mail\Mailer to override the getView() method
// app/libraries/MyApp/Mailer.php
*/
namespace MyApp\Mail;
@fedeisas
fedeisas / gist:5871546
Created June 26, 2013 20:51
Extending Sentry User Class
<?php
// In /app/models/User.php
use Cartalyst\Sentry\Users\Eloquent\User as SentryUserModel;
class User extends SentryUserModel {}
// In /app/config/packages/cartalyst/sentry/config.php *Omited some parts for brevity
return array(
'users' => array(
@fedeisas
fedeisas / server.cap
Created November 29, 2013 19:14
Capistrano server tail
namespace :server do
desc "Tail server log"
task :tail do
on roles(:app) do
trap("INT") { puts puts "\e[0;36mInterrupted\e[1;0m"; exit 0; }
trap("SIGINT") { puts puts "\e[0;36mInterrupted\e[1;0m"; exit 0; }
latest_log = capture(sprintf("ls -tr /var/www/%s/shared/app/storage/logs/*.txt | tail -1 | head -1", fetch(:stage)))
if(!latest_log.empty?)
<?php
use Illuminate\Routing\Controller;
class BaseController extends Controller
{
public function __construct()
{
$this->beforeFilter(function()
hash: {
options: {
mapping: 'public/assets.json',
flatten: false,
hashLength: 8,
hashFunction: function(source, encoding) {
return require('crypto').createHash('sha1').update(source, encoding).digest('hex');
}
},
js: {
angular.module('api', [])
.factory('Photos', ['$http', function ($http) {
return {
items: [],
busy: true,
stadium_id: null,
max_id: null,
hasMore: true,
resetItems: function () {
this.items = [];