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
#include <dlfcn.h> | |
#include <execinfo.h> | |
// Uso: callmemaybe(2) así por ser… | |
__attribute__((noinline)) NSString *callmemaybe(int item) { | |
void *bt[1024]; | |
int bt_size; | |
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
require 'webdrone' | |
a0 = Webdrone.create browser: :chrome, create_outdir: true, timeout: 30 | |
a0.open.url 'http://www.delta.com/' | |
a0.shot.screen 'inicio' | |
a0.form.set 'originCity', 'SCL' | |
a0.form.set 'destinationCity', 'SDQ' | |
a0.form.set 'departureDate', '12/24/2015' | |
a0.form.set 'returnDate', '1/30/2016' |
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
require 'webdrone' | |
a0 = Webdrone.create browser: :chrome, timeout: 10 | |
def bajar_excel_spensiones(a0, y, m, d) | |
a0.open.url 'http://www.spensiones.cl/safpstats/stats/apps/vcuofon/vcfAFP.php?tf=A' | |
a0.form.set 'aaaaVCF', y | |
a0.form.set 'mmVCF', m | |
a0.form.set 'ddVCF', d | |
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
require 'webdrone' | |
a0 = Webdrone.create browser: :firefox, timeout: 10 | |
def entrar_dga(a0) | |
a0.open.url 'http://dgasatel.mop.cl/' | |
a0.clic.on 'Ingrese Aquí' | |
a0.clic.on 'Entrar' | |
end |
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
#!/bin/bash | |
export DISPLAY=:0 | |
cd $(dirname "$0") | |
# tira la salida std y err de este script a este archivo | |
exec >> spension.log 2>&1 | |
# que muestre los comandos | |
set -x |
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
<script type="text/vnd.graphviz" id="graphviz"> | |
digraph G { | |
"realizar solicitud de compra" [shape=box]; | |
"analizar presupuesto" [shape=box]; | |
"realizar informe caso" [shape=box]; | |
"tomar medidas" [shape=box]; | |
"realizar cotización" [shape=box]; | |
"inicio" -> | |
"realizar solicitud de compra" -> |
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
-- THIS SCRIPT HAS NOT BEEN TESTED, PLEASE CHECK CAREFULLY BEFORE RUNNING IT | |
-- USE AT YOUR OWN RISK | |
-- Function: public.clone_schema(text, text, boolean) | |
-- DROP FUNCTION public.clone_schema(text, text, boolean); | |
CREATE OR REPLACE FUNCTION public.clone_schema( | |
source_schema text, | |
dest_schema text, |
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
#!/usr/bin/env ruby | |
module ForkEach | |
def fork_each(max = 4) | |
pids = [] | |
self.each do |item| | |
pids << fork { yield item } | |
pids.delete(Process.wait 0) if pids.length >= max | |
end | |
pids.each { |pid| Process.wait pid } |
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
#!/usr/bin/env ruby | |
# sudo gem install ruby-progressbar | |
require 'ruby-progressbar' | |
module ForkEach | |
def fork_each(progressbar, max = 4) | |
pids = [] | |
self.each do |item| | |
progressbar.increment |
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
class String # :nodoc: | |
def valid_rut?(out: {}) | |
splitted = strip.split('-') | |
rut = splitted.first.delete('.').to_i | |
dv = rut.dv | |
valid = dv == splitted.last.upcase | |
if valid | |
out[:rut] = rut | |
out[:dv] = dv |
OlderNewer