This file contains hidden or 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 validaRut(campo){ | |
if ( campo.length == 0 ){ return false; } | |
if ( campo.length < 8 ){ return false; } | |
campo = campo.replace('-','') | |
campo = campo.replace(/\./g,'') | |
var suma = 0; | |
var caracteres = "1234567890kK"; | |
var contador = 0; |
This file contains hidden or 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
/** | |
* Very simple way to check if a file exists on this domain. | |
* Use with the jQuery library. | |
* | |
* Important: Works only on the same domain. | |
* Cross-domain-requests have to be done in another way (see JSONP)! | |
* | |
* Use: console.log( "/data/list.json".fileExists() ); | |
*/ | |
String.prototype.fileExists = function() { |
This file contains hidden or 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
/* | |
For more detailed instructions on how to use this script, sign up with your email here: | |
http://adamloving.com/internet-programming/how-toexport-facebook-page-fans | |
DISCLOSURE: This javascript runs in your browser pretending to be you | |
looking through your page fans. Facebook should have no problem with this, | |
but who knows if they will think it is strange to see you looking through | |
all your fans so quickly (the script waits 3s before requesting each page). | |
I've had no problem running this so far for 1000s of page fans, but I |
This file contains hidden or 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
var http = require('http'); | |
var connect = require('connect'); | |
var httpProxy = require('http-proxy'); | |
var proxy = module.exports = function(options){ | |
return function (req, res) { | |
var proxy = new httpProxy.HttpProxy(req, res); | |
var headerFields = null; | |
This file contains hidden or 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
$.fn.extend | |
myplugin: (options) -> | |
self = $.fn.myplugin | |
opts = $.extend {}, self.default_options, options | |
$(this).each (i, el) -> | |
self.init el, opts | |
self.log el if opts.log | |
$.extend $.fn.myplugin, | |
default_options: |
This file contains hidden or 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
zip = (arr1, arr2) -> | |
basic_zip = (el1, el2) -> [el1, el2] | |
zip_with basic_zip, arr1, arr2 | |
# I wrote two implementations of `zipWith`: one is iterative, and one is recursive. Feel free to do some benchmarks if you feel like it :) | |
# zip_with, iterative style | |
zip_with = (func, arr1, arr2) -> | |
min = Math.min arr1.length, arr2.length | |
ret = [] |
This file contains hidden or 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
/** | |
* $.parseParams - parse query string paramaters into an object. | |
*/ | |
(function($) { | |
var re = /([^&=]+)=?([^&]*)/g; | |
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space | |
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );}; | |
$.parseParams = function(query) { | |
var params = {}, e; | |
while ( e = re.exec(query) ) { |
This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
license: gpl-3.0 | |
height: 960 | |
border: no | |
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling |
This file contains hidden or 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
/* | |
* "%s %s %s".format("Format", "For", "Javascript"); | |
* Based on PHPJS sprintf. | |
* | |
* @author: Nijikokun <[email protected]> | |
* @copyright: 2011 (c) Nijikokun | |
*/ | |
String.prototype.format=function(){var k=arguments,q=0,o=function(b,a,f,c){f||(f=" ");a=b.length>=a?"":Array(1+a-b.length>>>0).join(f);return c?b+a:a+b},m=function(b,a,f,c,g,d){var e=c-b.length;e>0&&(b=f||!g?o(b,c,d,f):b.slice(0,a.length)+o("",e,"0",!0)+b.slice(a.length));return b},n=function(b,a,f,c,g,d,e){b>>>=0;f=f&&b&&{2:"0b",8:"0",16:"0x"}[a]||"";b=f+o(b.toString(a),d||0,"0",!1);return m(b,f,c,g,e)};return this.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g, | |
function(b,a,f,c,g,d,e){var i,j;if(b=="%%")return"%";var h=!1;j="";var l=g=!1;i=" ";for(var r=f.length,p=0;f&&p<r;p++)switch(f.charAt(p)){case " ":j=" ";break;case "+":j="+";break;case "-":h=!0;break;case "'":i=f.charAt(p+1);break;case "0":g=!0;break;case "#":l=!0}c=c?c=="*"?+k[q++]:c.charAt(0)=="*"?+k[c.slice(1,-1)]:+c:0;c<0&&(c=-c,h=!0);if |
OlderNewer