This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SYMFONY_FOLDER=$1 | |
METHOD=$2 | |
HTTPDUSER=$3 | |
if [[ ! -d $SYMFONY_FOLDER || ! -e ${SYMFONY_FOLDER}/app/AppKernel.php ]] | |
then | |
echo "No es una capeta Symfony" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\DemoBundle\Validator\Contraints; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\ConstraintValidator; | |
class RutValidator extends ConstraintValidator | |
{ | |
public function validate($value, Constraint $constraint) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- Symfony2 ----------------------------------------- | |
app/bootstrap.php.cache | |
app/bootstrap_cache.php.cache | |
app/config/parameters.ini | |
app/config/parameters.yml | |
app/cache/* | |
app/logs/* | |
vendor/* | |
web/bundles/* | |
web/css/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set ssid=%1 | |
set key=%2 | |
IF [%1]==[] (set ssid=entelwifi) ELSE (set ssid=%1) | |
IF [%2]==[] (set key=angelitolindo) ELSE (set key=%2) | |
netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%key% | |
netsh wlan stop hostednetwork | |
netsh wlan start hostednetwork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
flock -x -w 200 || exit 1 | |
yes First | |
yes Second | |
yes Third | |
} 200>~/.lock/my_yes_command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import math | |
import sys | |
from random import randrange | |
class MinesWeeper: | |
CELL_BLANK = None | |
CELL_MINE = "M" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW generator_16 | |
AS SELECT 0 n UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL | |
SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL | |
SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL | |
SELECT 9 UNION ALL SELECT 10 UNION ALL SELECT 11 UNION ALL | |
SELECT 12 UNION ALL SELECT 13 UNION ALL SELECT 14 UNION ALL | |
SELECT 15; | |
CREATE OR REPLACE VIEW generator_256 | |
AS SELECT ( ( hi.n << 4 ) | lo.n ) AS n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
function addThousandSeparators(num, thousandSeparator) { | |
if (null == thousandSeparator) { | |
thousandSeparator = '.'; | |
} | |
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod('regexp', function (value, element, params) { | |
return this.optional(element) || params.test(value); | |
}, 'Por favor, escribe un formato valido.'); |
OlderNewer