Skip to content

Instantly share code, notes, and snippets.

@poguez
poguez / Maps_directions_dragabble-Puebla-Veracruz
Created March 8, 2014 07:07
Ejemplo Javascript de Rutas y direcciones dragabble Google Maps V3 caminando de Puebla-Veracruz, pasando por Tlaxcala y Córdoba.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Ejemplo de rutas Draggable</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
@poguez
poguez / gist:9434005
Created March 8, 2014 16:01
Geocoding con Python
import urllib2
import pprint
import json
add = "Buckingham Palace, London, SW1A 1AA"
add = urllib2.quote(add)
geocode_url = "http://maps.googleapis.com/maps/api/geocode/json?address=%s&sensor=false&region=uk" % add
print geocode_url
req = urllib2.urlopen(geocode_url)
jsonResponse = json.loads(req.read())
pprint.pprint(jsonResponse)
@poguez
poguez / gist:6fd31e34bd157103a96b
Created May 23, 2014 17:36
Problem installing CKAN release 2.2
---- Begin output of /home/ckan/pyenv/bin/pip install -e /home/ckan/ckan ----
STDOUT: Obtaining file:///home/ckan/ckan
Running setup.py (path:/home/ckan/ckan/setup.py) egg_info for package from file:///home/ckan/ckan
error: Namespace package problem: ckanext.stats is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
Complete output from command python setup.py egg_info:
running egg_info
@poguez
poguez / ckan_stats.py
Created September 16, 2014 00:23
Este es un script para sacar algunas métricas de ckan mediante API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import urllib2
def ckan_action(call_action):
url = "http://datamx.io/api/3/action/" + call_action
organization_list = json.load(urllib2.urlopen(url))
@poguez
poguez / Instrucciones.txt
Last active August 29, 2015 14:18
Entorno para el taller de Rails
Instala Vagrant en tu sistema:
https://www.vagrantup.com/downloads.html
Instala Virtual Box:
https://www.virtualbox.org/wiki/Downloads
Clona el repositorio de:
https://github.com/rails/rails-dev-box
$ git clone https://github.com/rails/rails-dev-box.git
It's almost time!! PARC is hosting the fourth CCNxCon technical conference - “Driving the next generation Internet: Content-Centric Networking Update & Conference” - at the PARC Pake Auditorium in Palo Alto, California on May 18 - 21, 2015.
The conference will highlight technical progress and share developer experiences from diverse industries and institutions. We’ll present our technical progress as well as have sessions, talks, demos and posters from industry and academia.
Sessions and talks will discuss progress on the pressing issues of security, privacy, APIs, network and distributed computing, and development tools, as well as the challenges of scale in a connected and mobile world. Day one of the conference is a deep dive for developers - a hands-on tutorial followed by an all-day hackathon / interop session. Days two and three will explore advances, experiences and proposals in the areas of protocols, security, software, and projects from the community. Day four will focus on architectural di
@poguez
poguez / Vagrantfile
Last active August 16, 2016 22:37
Vagrantfile, docker ubuntu 14.04
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "192.168.33.10"
@poguez
poguez / slack_delete_old_files_script.py
Created March 26, 2018 06:44
Script for deleting files from slack with legacy API for users. Original source: https://gist.github.com/jackcarter/d86808449f0d95060a40
#################################################################################
#
# Script for deleting files from slack with legacy API for users.
#
# Original source: https://gist.github.com/jackcarter/d86808449f0d95060a40
#
#################################################################################
import requests
@poguez
poguez / control-esc
Created February 17, 2020 09:50
Map Left Control to Escape and Control for HHKB Lite
{
"title": "Change Left Control to Esc and Control",
"rules": [
{
"description": "Post Esc if Control is tapped, Control if held.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_lock",
@poguez
poguez / clicka-botones-con-delay.js
Last active March 11, 2020 10:13
Click on two buttons repeatedly with a delay on the browser
function clickaRetry(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"retry-request\"]").click()
}
function clickaConfirm(){
document.querySelector("body > console-base-page > stencil-router > stencil-route-switch > stencil-route > datastore-request-status-page > div > enhanced-table > div > table > tbody > tr > td > div > confirmation-button div > button[data-role=\"confirm\"]").click()
}
function sleep(milliseconds) {
let timeStart = new Date().getTime();