Skip to content

Instantly share code, notes, and snippets.

Tomás Pollak tomas

Block or report user

Report or block tomas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomas
tomas / validador_rut.js
Created Nov 8, 2018
Validador de RUT Chileno en JS (Javascript)
View validador_rut.js
// validador de RUT JS, por @tomaspollak
function validateRut(str) {
if (!str || String(str).length < 6) return false;
var floor = Math.floor,
clean = String(str).replace(/[^0-9]/g, '');
var m = 0, s = 1, t = parseInt(clean.substring(0, clean.length-1));
while (t > 0) {
View chile_rut.rb
# by @tomaspollak
module ChileRut
def self.validate(str)
return false unless str.to_s.length > 6
digit = get_digit(str[0..-2].gsub(/[^0-9]/, ''))
digit == str.to_s[-1..-1].upcase
end
def self.get_digit(num)
m, s, t = 0, 1, num.to_i
@tomas
tomas / gist:1504355
Created Dec 21, 2011
brew install gstreamer
View gist:1504355
/bin/sh ../libtool --silent --tag=CC --mode=compile /usr/bin/llvm-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/usr/local/Cellar/libffi/3.0.9/include -I/usr/local/Cellar/gettext/0.18.1.1/include -D_GNU_SOURCE -DGST_EXPORTS -DG_LOG_DOMAIN=g_log_domain_gstreamer -DGST_MAJORMINOR=\""0.10"\" -DGST_DISABLE_DEPRECATED -I../libs -I.. -I../libs -I.. -D_REENTRANT -I/usr/local/Cellar/glib/2.30.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.30.2/lib/glib-2.0/include -I/usr/local/Cellar/gettext/0.18.1.1/include -I/usr/local/Cellar/glib/2.30.2/include -DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -I/usr/include/libxml2 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs -O3 -w -pipe -march=core2 -msse4 -funroll-loops -fstrict-aliasing -fno-common -c -o li
You can’t perform that action at this time.