This file contains 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
// Verificar registro y descargar comprobante | |
var data = new FormData(); | |
// cambiar por el CURP a verificar | |
data.append("curphd", "LOOA531113HTCPBN07"); | |
var xhr = new XMLHttpRequest(); | |
xhr.withCredentials = true; | |
xhr.addEventListener("readystatechange", function() { | |
if(this.readyState === 4) { |
This file contains 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
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.pem with the following command: | |
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import http.server |
This file contains 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
""" | |
From: https://github.com/darius/sketchbook/blob/master/regex/integrated1.py | |
Integrate the right-to-left top-down operator-precedence parser with | |
the simplest terminating NFA code. | |
""" | |
def match(re, s): return run(prepare(re), s) | |
def run(states, s): |
This file contains 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
### Remove previous installs on /boot | |
´´´ | |
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge | |
´´´ | |
### Reduce pdf size | |
´´´ | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=IAFinTech.pdf draft_IAFinTech.pdf |
This file contains 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/sh | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains 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
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain. | |
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade. | |
The syntax mimic Blade statements, however identation differs in some cases. | |
- var newline = "\r\n" | |
- var loopIterator = '$iterator' | |
//- @extends mixin | |
Example: +extends('layouts/master') | |
Compiled: @extends('layouts/master') |
This file contains 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
//taken from http://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax | |
function ajax_download(url, data) { | |
var $iframe, | |
iframe_doc, | |
iframe_html; | |
if (($iframe = $('#download_iframe')).length === 0) { | |
$iframe = $("<iframe id='download_iframe'" + | |
" style='display: none' src='about:blank'></iframe>" |
This file contains 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
select.form-control + .chosen-container.chosen-container-single .chosen-single { | |
display: block; | |
width: 100%; | |
height: 34px; | |
padding: 6px 12px; | |
font-size: 14px; | |
line-height: 1.428571429; | |
color: #555; | |
vertical-align: middle; | |
background-color: #fff; |
This file contains 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
Perl and PHP Regular Expressions | |
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters. | |
All Major Credit Cards | |
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa. | |
//All major credit cards regex | |
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/' |
This file contains 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
#coding: utf-8 | |
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template | |
@route('/') | |
@route('/index.html') | |
def index(): | |
return '<a href="/hello">Go to Hello World page</a>' | |
@route('/hello') | |
def hello(): |
NewerOlder