Skip to content

Instantly share code, notes, and snippets.

View djnet00's full-sized avatar

Julián Mesa djnet00

View GitHub Profile
<?php
function ascii($value){
$foreign = array(
'/æ|ǽ/' => 'ae',
'/œ/' => 'oe',
'/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|А/' => 'A',
'/à|á|â|ã|ä|å|ǻ|ā|ă|ą|ǎ|ª|а/' => 'a',
'/Б/' => 'B',
@extends('plantilla')
@section('titulo')
Noticias
@stop
@section('contenido')
<h1>NOTICIAS</h1>
<hr />
<?php
$titulo = "Formulario";
require("includes/header.php");
$nombre = $_POST["nombre"];
$apellido = $_POST["apellido"];
$ciudad = $_POST["ciudad"];
$telefono = $_POST["telefono"];
$nacimiento = $_POST["nacimiento"];
@djnet00
djnet00 / gist:9740802
Created March 24, 2014 14:09
Buscar y eliminar en un array
Better solution of multidimensional searching.
<?php
function multidimensional_search($parents, $searched) {
if (empty($searched) || empty($parents)) {
return false;
}
foreach ($parents as $key => $value) {
$exists = true;

Setup new mac from scratch

These commands are good as of 2010-11-18.

/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

Install xcode (download, or on the OS X install DVD)

http://developer.apple.com/technology/xcode.html
try {
DB::connection()->getPdo()->beginTransaction();
// database queries here
DB::connection()->getPdo()->commit();
} catch (\PDOException $e) {
// Woopsy
DB::connection()->getPdo()->rollBack();
}
<?php
class MatchesControllerTest extends TestCase
{
protected $user;
protected $profile;
public function setUp()
{
parent::setUp();
DB::beginTransaction();
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.1.8 (2013-12-13)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
exit('Only to be used as an helper for your IDE');
@djnet00
djnet00 / gist:7349901
Created November 7, 2013 06:18
Workaround for buggy footer fixed position when virtual keyboard is on/off
// Workaround for buggy footer fixed position when virtual keyboard is on/off
$(document).on('touchstart focus','input, textarea', function (e) {
$('footer, .float-buttons').css('display', 'none');
})
.on('blur','input, textarea', function (e) {
$('footer, .float-buttons').css('display', 'block');
});
$.extend $.fn.datepicker.defaults,
format: 'yyyy-mm-dd'
weekStart: 1
###
<input type="text" id="from" class="datepicker" data-dependent="to" data-diff="7" />
<input type="text" id="to" class="datepicker" />
###
$("input.date").each ->