Skip to content

Instantly share code, notes, and snippets.

View bran921007's full-sized avatar
🏠
Working from home

Fran Perez bran921007

🏠
Working from home
View GitHub Profile
@bran921007
bran921007 / gist:2e6d6ba7d9cbff91ee92
Created April 5, 2015 00:11
House of card Kata - Recursive function - Sequence - Series (sumatorias)
http://stackoverflow.com/questions/27383686/how-could-i-have-made-this-ruby-kata-solution-into-a-recursive-method
https://laracasts.com/discuss/channels/general-discussion/house-of-cards-kata
http://cifrasyteclas.com/2012/12/07/cuantas-cartas-hacen-falta-para-construir-un-castillo-de-naipes-reto-77-propiedad-1/
Description:
You want to build a standard house of cards, but you don't know how many cards you will need. Write a program which will count the minimal number of cards according to the number of floors you want to have. For example, if you want a one floor house, you will need 7 of them (two pairs of two cards on the base floor, one horizontal card and one pair to get the first floor). Here you can see which kind of house of cards I mean: http://www.wikihow.com/Build-a-Tower-of-Cards
Details (Ruby & JavaScript)
curl -s https://getcomposer.org/installer | php -- --quiet --install-dir=$OPENSHIFT_DATA_DIR
php $OPENSHIFT_DATA_DIR/composer.phar update
ln -s public php
<?php
/*
PHP Library - Social Security Number-related functions
Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved.
This work is licensed under the Creative Commons Attribution License. To view
a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
94305, USA.
@extends('app')
@section('content')
<div class="container">
Editar: <h1>{{$article->title }}</h1>
{!! Form::model($article, ['method' => 'PATCH', 'action' => ['HomeController@update', $article->id]]) !!}
@include('partials.form',['buttonSubmit'=>'Actualizar Articulo'])
@extends('app')
@section('content')
<div class="container">
{!! Form::open(['action' => 'HomeController@store'])!!}
@include('partials.form',['buttonSubmit'=>'Actualizar Articulo'])
{!! Form::close() !!}
</div>
"dtisgodsson/twilio": "dev-master"
Update your Composer packages:
composer update
Next, add the Service Provider to our application config. Open up app/config/app.php and in the providers array, add the following line:
'Dtisgodsson\Twilio\TwilioServiceProvider',
Finally, publish the package configuration so we can add our own Twilio details.
php artisan config:publish dtisgodsson/twilio
@bran921007
bran921007 / gist:0c2282aa7836ff9e79f8
Created May 9, 2015 17:06
VirtualHost - SSL en digital Ocean
<VirtualHost *:443>
ServerName sexylip.co
DocumentRoot /var/www/linc/public
<Directory /var/www/linc/public>
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
@bran921007
bran921007 / gist:8d037cc6ddcdedad00d3
Created May 12, 2015 04:06
Entornos de desarrollo local y remoto en Laravel
El primer paso para definir nuestros entornos, es modificar el fichero bootstrap->start.php.
En mi caso, he definido dos entornos de desarrollo: uno local y otro remoto:
$env = $app->detectEnvironment(array(
'local' => array('*localhost*'),
'remoto'=> array('*azurewebsites.net'),
));
@bran921007
bran921007 / gist:64edb01d1ffeba38cf9f
Created May 26, 2015 10:46
Stripe backend - PHP Laravel
//use Stripe\Stripe;
\Stripe\Stripe::setApiKey('SECRET API KEY');
$token = Input::get('token');
$amount = Input::get('amount');
try {
$charge = \Stripe\Charge::create(array('card' => $token, 'amount' => $amount, 'currency' => 'usd'));
} catch (Error\Card $e) {
return Response::json(array(
'status' => 'failed',
@bran921007
bran921007 / gist:d973a8623b6a6beae86e
Created May 26, 2015 11:26
Twilio function backend
Backend:
1) Alternativa
public function twilio($carpeta, $sonido){
$twiml = new Services_Twilio_Twiml();
// $twiml->say('hola', array('voice' => 'alice'));
$twiml->play('http://104.236.236.57/sounds/'.$carpeta.'/'.$sonido.'.mp3');