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
/** | |
* Este script de javascript permite trabajar transparentemente solicitudes que requieren | |
* protección del token CSRF por medio de AJAX JQUERY. | |
* Esto te permitirá hacer solcitudes a web Services de Django por medio de AJAX Jquery. | |
* Para utilizarlo basta con integrar el archivo DjangoAjax.js en tu directorio de JS y hacer referencia a él en tus templates | |
* que requieren del uso de AJAX por POST o algún otro que requiera el token CSRF. | |
* Este script está basado en la documentación oficial de Django https://docs.djangoproject.com | |
*/ | |
$(function(){ |
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 | |
__author__ = 'gaspar dzul' | |
from pyquery import PyQuery as pq | |
# ejemplo consulta valor del peso mexicano | |
print("---- ejemplo de consulta de divisa ----") | |
jquery = pq(url="http://www.cambiodolar.mx/") | |
valor_dolar_pesos_mx = jquery('div.valor').text() | |
fecha_consulta = jquery('p.day').text() |
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
/** | |
* Created by gaspar on 22/sept/15. | |
*/ | |
//angularJS | |
(function () { | |
var app = angular.module('app', | |
//ejemplo de algun controlador | |
['app.mainController'] | |
); |
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 | |
__author__ = 'gaspar' | |
#Ejemplo de Web Scraping utilizando PyQuery | |
# Este scrpit tiene 3 ejemplos | |
""" | |
1. Consulta de divisas | |
2. Descarga de articulos de tecnilogía de la BBC Español | |
3. Descarga de Wallpapers de Microsoft. | |
Este Scrpit tiene objetivos estrictamente educativos. | |
""" |
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
function addColumn(tabla,columna,num_colum_a_insertar){ | |
/** Esta funcion inserta una columna html despues de una columna seleccionada | |
* tabla = la tabla que modificamos | |
* columna = es el indice de la columna en donde insertaremos una nueva columna | |
* num_colum_a_insertar = cuantas columnas se van a insertar despues de la columna seleccionada | |
* Created by gaspardzul on 8/10/15. | |
*/ | |
$(tabla).find('tr').each(function(i,row){ // recorremos todas sus rows | |
var primer_td= $(row).find('td,th')[columna]; // obtenemos columna (por que insertaremos despues de esta) | |
if(primer_td.tagName=='TH'){ |
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
/** | |
* Created by gaspardzul on 28/11/16. | |
* Permite llevar un tracking visual de tu tiempo | |
* Ejemplo de uso | |
* <span id="timer" data-hr="4" data-min="10" data-sec="4"></span> | |
* JS: $('#timer').tracking(); | |
* Pasamos como parametros la hora , minuto y segundo a tra ves delos atributos data del elemento | |
*/ | |
(function($){ | |
$.fn.extend({ |
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
s |