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:3dd4ff0765e4b6c87163
Created May 26, 2015 12:08
Twilio Route and Launch example
Route::post('/twilio/{carpeta}/{sonido}', ['as' => 'dashboard', 'uses' => 'HomeController@twilio']);
----------
$host = parse_url(Request::url(), PHP_URL_HOST);
$url = 'http://' . $host . '/twilio'.'/'.$carpeta.'/'.$sonido;
Twilio::to('+1'.$telefono)->call($url);
@bran921007
bran921007 / gist:daa5ce4b387e6d7f39d6
Created May 28, 2015 04:01
function detectar insulto
function detectarInsultos($string){
function prep_regexp_array(&$item){
$item = "#$item#i";
}
function stars($matches){
return substr($matches [0] , 0, 1).str_repeat("*", strlen($matches [0] )-1);
}
@bran921007
bran921007 / Model.php
Created May 28, 2015 08:59
Validar numero de telefono en muchos formatos y modificarlos segun un formato especifico
public function formatPhone($phone)
{
if ( preg_match('/^[+]?([\d]{0,3})?[\(\.\-\s]?([\d]{3})[\)\.\-\s]*([\d]{3})[\.\-\s]?([\d]{4})$/', $phone, $matches)) {
$matches[1] = ($matches[1]=='') ? '+1' : $matches[1];
return $matches[1].$matches[2].$matches[3].$matches[4];
}
@bran921007
bran921007 / index.html
Created June 4, 2015 22:35
animacion sprite css - subzero
<div id="subzero"></div>
// Disable the payment/submit button until everything has loaded
// (if Stripe fails to load, we can't progress anyway)
$(document).ready(function() {
$("#payment-button").prop('disabled', false)
})
var handler = StripeCheckout.configure("customButtonA", {
key: '<yourpublishablekey',
token: function(token, args){
var $input = $('<input type=hidden name=stripeToken />').val(token.id);
wget -r -k http://www.sitio.com
<?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.
http://www.elfqrin.com/usssndriverlicenseidgen.php
www.ssnvalidator.com
@bran921007
bran921007 / gist:446a8afcb720884073a6
Created June 27, 2015 20:13
Component ReactJS - get Ajax
<script src="https://fb.me/react-0.13.3.js"></script>
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script>
<script type="text/jsx">
var ClientesTotal = React.createClass({
getInitialState:function(){
return {
clientes: ""
@bran921007
bran921007 / index.html
Last active August 29, 2015 14:23 — forked from asainz/index.html
<div class="container container--rigid">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
<div class="container container--fluid">
<div class="box"></div>
<div class="box"></div>