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:2143a427cebf55d168cf
Created December 19, 2014 15:37
codigo ejecutar jquery en el consola de chrome
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict()
@bran921007
bran921007 / gist:5c1fbb8444c0549a315a
Created December 31, 2014 17:49
Seleccionar todos los checkbox
//class="chkSelectAll" esta en el checkbox principal(th) que debe seleccionar todos los usuarios
//class="file-todo" son los checkbox particulares de cada td en una tabla
$('.chkSelectAll').click(function () {
$('.file-todo').prop('checked', $(this).is(':checked'));
});
$('.file-todo').click(function () {
<!doctype html>
<html>
<head>
<link href="http://s3.amazonaws.com/codecademy-content/courses/ltp2/css/bootstrap.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<style>
html,body {
font-family: 'Roboto', sans-serif;
color: #404040;
background-color: #eee;
var query = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid=76456&format=json"
url = query;
$.getJSON(url, function(data) {
console.log( data );
});
@bran921007
bran921007 / gist:7cbc2ed3543abd501860
Created January 24, 2015 00:13
Mysql con expresiones regulares
UPDATE TABLE SET COLUMN = REPLACE(COLUMN, 'oldvalue', 'newvalue')
WHERE COLUMN REGEXP 'oldvalue';
Donde:
column es el nombre del campo en la tabla.
oldvalue es aquello que deseamos modificar.
newvalue es la nueva cadena que reemplaza la anterior
@bran921007
bran921007 / gist:a634e60d77025bbf7c9a
Created January 25, 2015 07:13
combobox - lista de paises
<select class="grid-4" id="country" name="country"><option value="">Seleccionar pa&#237;s</option>
<option value="AF">Afganist&#225;n</option>
<option value="AL">Albania</option>
<option value="DE">Alemania</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguila</option>
<option value="AQ">Ant&#225;rtida</option>
<option value="AG">Antigua y Barbuda</option>
<option value="AN">Antillas Neerlandesas</option>
public function index()
{
$client = new Client();
// Login page
$crawler = $client->request('GET', 'https://email.linc.do/iredadmin/login');
$form = $crawler->selectButton('Login')->form();
$crawler = $client->submit($form, array('username' => '[email protected]', 'password' => '*****'));
<VirtualHost *:80>
DocumentRoot /var/www/linc/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyRequests Off
<proxy *>
Order deny,allow
Allow from all
</proxy>
ProxyPreserveHost On
<img onclick="jQuery('#file').click()" id="imageUpload" src="uploads/images/flyer_picture/{{$fly->detail}}" style="width:200px;height:200px;"/>
<input type="file" id="file" name="pic" style="display: none;"/>
<script>
//-------------------------------------------
//Subir imagen
$("#file").change(function(){
readURL(this);
var inputFileImage = document.getElementById("file");
var file = inputFileImage.files[0];
sudo yum install wget
wget http://chrome.richardlloyd.org.uk/install_chrome.sh
chmod u+x install_chrome.sh
./install_chrome.sh
execute "Please start Google Chrome as a normal user."
Open /opt/google/chrome folder
open google-chrome file or vi google-chrome
exec -a "$0" "$HERE/chrome" "$@"