Skip to content

Instantly share code, notes, and snippets.

@ig10
ig10 / CookieHandler.js
Last active December 27, 2015 00:59
JS+jQuery Cookie Handler
var Cookie = {
existe: function(nombre){
var cookies = document.cookie.split(';');
var existe = false;
$j.each(cookies, function(c, v){
if($j.trim(v).split('=')[0] == nombre){
existe = true;
}
});
return existe;
@ig10
ig10 / search&destroy.rb
Created February 21, 2014 17:40
Search & Destroy IMG's
#!/usr/bin/ruby
# -*- encoding : utf-8 -*-
#Author: Ignacio Diez (i10)
#Date: July 14, 2012
puts "Eliminando Imagenes del Comparador\n====================================\n > Seleccione Sistema Operativo:\n"
puts " 1 - Mac\n 2 - Ubuntu"
raiz = {1 => "users", 2 => "home"}
@ig10
ig10 / SBT2-custom-keys.sublime-keymap
Last active August 29, 2015 13:56
OsxCustomKeysSBT2
[
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["super+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": false} },
{ "keys": ["super+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": false} },
{ "keys": ["super+shift+left"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
{ "keys": ["super+shift+right"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
{ "keys": ["super+shift+up"], "command": "swap_line_up" },
@ig10
ig10 / excel_irr.rb
Last active August 29, 2015 13:57
Excel IRR function in Ruby
module I10
# Returns Internal Rate of Return (TIR Spanish) for a cash
# flow in numbers, with the payments as values.
# @param transactions : Array which contains initial project cost,
# and the payments over the time.
def I10.irr(transactions, max_iterations = 20)
min = 0.0
max = 1.0
npv = 0
iterations = 0
@ig10
ig10 / OwnTabs.js
Created April 15, 2014 22:28
jQuery simple tabs
var Tabs = function(){
function init(){
$('.options > div > a').on('click', function(e){
e.preventDefault();
var $this = $(this);
if(!$this.hasClass('active')){
var activeTab = $('.active');
var activeElement = $(activeTab.attr('href'));
var triggeredElement = $($this.attr('href'));
@ig10
ig10 / ts3_sv_install.sh
Last active April 13, 2019 18:18
Install TeamSpeak 3 Server in Ubuntu Machine
#!/bin/bash
VERSION="3.3.0"
echo "-> Downloading TeamSpeak 3 Version $VERSION"
wget http://ftp.4players.de/pub/hosted/ts3/releases/$VERSION/teamspeak3-server_linux-amd64-$VERSION.tar.gz
echo "-> Decompressing Files... "
tar xzf teamspeak3-server_linux-amd64-$VERSION.tar.gz
@ig10
ig10 / cpffill.js
Created August 18, 2014 23:44
CPFFillFromList
(function () {
function randomize(arr) {
return arr[Math.floor(Math.random() * (arr.length - 0))];
}
var cpfList = ["79722351800",
"08551583875",
"19072143051",
"12687174440",
"84077884659",
"26882180008",
@ig10
ig10 / ig10_settings.json
Last active August 29, 2015 14:06
SBT2Cfg
{
"atomic_save": true,
"color_scheme": "Packages/Theme - Nil/Tubnil.tmTheme",
"draw_white_space": "all",
"font_face": "Monaco",
"font_size": 12.0,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
@ig10
ig10 / cepfill.js
Created October 7, 2014 23:25
CEPFillFromList
(function () {
function randomize(arr) {
return arr[Math.floor(Math.random() * (arr.length - 0))];
}
var cepList = ["69921722",
"69915848", "69918618", "69903034",
"69921749", "69900312", "69900309",
"69900214", "69918048", "69918012",
"69900270", "69900273", "69918060",
"69900259", "69917746", "69900092",
@ig10
ig10 / kompass2015.js
Last active August 29, 2015 14:16
Auto Fill Kompass 2015 Apply Forms
javascript:((function registerKompass() {
var step1 = {
radio: ["rdoServiceIn_0"],
common: {
"txtLastName": 'PASSPORT LAST NAME',
"txtFirstName": 'PASSPORT FIRST NAME',
"txtDob": 'yyyy-mm-dd',
"ddlCitizenship": 'COUNTRY', // CL == Chile
"txtEmailAddress": 'YOUR.EMAIL@gmail.com',
"txtEmailAddressConfirm": 'YOUR.EMAIL@gmail.com',