Skip to content

Instantly share code, notes, and snippets.

View gaulatti's full-sized avatar

Javier Godoy Núñez gaulatti

View GitHub Profile
@gaulatti
gaulatti / fbVideoDownloader.js
Last active January 17, 2023 14:26
Facebook Video Downloader (JS Console)
/*
* Facebook Video Downloader, Tested in Chrome / Safari
* rotvulpix - July11/2015@0918 CLST
*/
/*
* Usage: Go to video page (not modal window), and execute this code in console.
* If you want the HD Source, please see it on HD first.
*/
@gaulatti
gaulatti / Preferences.sublime-settings
Last active August 29, 2015 14:00
Sublime Settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"file_exclude_patterns": [],
"folder_exclude_patterns": [],
"font_face": "Ubuntu mono",
"font_options": ["gray_antialias"],
"font_size": 10,
@gaulatti
gaulatti / folderToISO.sh
Created May 7, 2014 16:24
Create ISO from Folder in OS X
hdiutil makehybrid -o ~/Desktop/image.iso ~/path/to/folder/to/be/converted -iso -joliet
@gaulatti
gaulatti / selectTablesForDrop.sql
Created May 12, 2014 16:53
Select Tables for drop in MySQL
SELECT concat('DROP TABLE IF EXISTS ', table_name, ';')
FROM information_schema.tables
WHERE table_schema = 'MyDatabaseName';
@gaulatti
gaulatti / validarRUT.html
Last active June 15, 2023 15:12
HTML5 Chilean RUT Validator
<!doctype html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Validador de RUT HTML5</title>
</head>
<body>
<form>
<input type="text" id="rut" name="rut" required oninput="checkRut(this)" placeholder="Ingrese RUT">
<button type="submit">Validar RUT y Enviar Form</button>
@gaulatti
gaulatti / RutAuthenticator.php
Created July 14, 2014 15:09
Login con RUT en Symfony2
<?php
namespace rotVulpix\TestBundle\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
@gaulatti
gaulatti / caller.js
Last active March 23, 2018 15:02
Dynamic (AJAX) Bootstrap Modal (Bootstrap 3)
$("[data-toggle='modal']").click(function(e) {
/* Prevent Default*/
e.preventDefault();
/* Parameters */
var url = $(this).attr('href');
var container = "#" + $(this).attr('data-container');
/* XHR */
$.get(url).done(function(data) {
@gaulatti
gaulatti / AjaxError.html.php
Last active August 29, 2015 14:04
Symfony2 Form Errors as JSON
<?php
// Errores desde Form
$errores = $view['form']->errors($form);
// Limpieza
$limpiezaUL = str_replace('<ul>','', $errores);
$limpiezaUL = trim(str_replace('</ul>','', $limpiezaUL));
// Separar Errores
#!/bin/bash
echo '===> install apc.so in OSX Mavericks'
mkdir -p ~/tmp/apc-deps
# Compile PCRE - Perl Compatible Regular Expressions
cd ~/tmp/apc-deps
curl -O ftp://ftp.csx.cam.ac.uk//pub/software/programming/pcre/pcre-8.33.tar.gz
tar -xvzf pcre-8.33.tar.gz
@gaulatti
gaulatti / checkboxAsDropdown
Last active August 29, 2015 14:06
Representing Checkboxes with Bootstrap Dropdowns
<!-- RadioButtons, about them the Dropdown will be filled -->
<input type="radio" name="ambito" class="selectable" value="1" data-caption="Ámbito 1">
<input type="radio" name="ambito" class="selectable" value="2" data-caption="Ámbito 2">
<input type="radio" name="ambito" class="selectable" value="3" data-caption="Ámbito 3">
<!-- Bootstrap Dropdown - empty -->
<div class="btn-group radio-selectable" data-radio="ambito">
<button type="button" class="btn btn-default dropdown-toggle btn-info" data-toggle="dropdown">
Seleccione <span class="caret"></span>
</button>