Skip to content

Instantly share code, notes, and snippets.

JuanPablo juanpabloaj

Block or report user

Report or block juanpabloaj

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
View stockquote.wsdl
<?xml version="1.0"?>
<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote/definitions"
xmlns:tns="http://example.com/stockquote/definitions"
xmlns:xsd1="http://example.com/stockquote/schemas"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="http://example.com/stockquote/schemas"
@juanpabloaj
juanpabloaj / AdjustWindowHeight.vim
Last active Mar 30, 2019
Automatically fitting a quickfix window height, consider a long line as many lines. based in http://vim.wikia.com/wiki/Automatically_fitting_a_quickfix_window_height
View AdjustWindowHeight.vim
au FileType qf call AdjustWindowHeight(3, 10)
function! AdjustWindowHeight(minheight, maxheight)
let l = 1
let n_lines = 0
let w_width = winwidth(0)
while l <= line('$')
" number to float for division
let l_len = strlen(getline(l)) + 0.0
let line_width = l_len/w_width
let n_lines += float2nr(ceil(line_width))
@juanpabloaj
juanpabloaj / README.md
Last active Mar 29, 2019
traefik consul header matching
View README.md

traefik and consul, manual register

consul and traefik up

docker-compose up -d

services up

docker-compose -f docker-compose-services.yaml up -d
@juanpabloaj
juanpabloaj / moda_media.py
Created May 30, 2012
ejemplo python: moda y mediana
View moda_media.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# http://docs.python.org/tutorial/datastructures.html
l = [ 1, 10, 4, 2, 4, 3, 3, 1, 1, 3]
print l
promedio = sum(l)/len(l)
View docker-compose.yaml
version: '3'
services:
traefik:
image: traefik # The official Traefik docker image
command: --api -c traefik.toml #--docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
View docker-compose.yaml
version: '3'
services:
traefik:
image: traefik # The official Traefik docker image
command: --api -c traefik.toml #--docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
@juanpabloaj
juanpabloaj / lastDays.sh
Created Mar 20, 2012
git: latest changes grouped by day
View lastDays.sh
#!/bin/bash
a=""
b=""
for i in $(seq 0 10)
do
b=$(git diff --shortstat "@{ $i day ago }")
if [[ "$b" != "$a" ]]; then
echo $(date --date="$i days ago" +%F) $b
fi
a=$b
@juanpabloaj
juanpabloaj / user.go
Created Mar 1, 2019
go test user_test.go user.go
View user.go
package user
import "fmt"
func ShowUsers() int {
return 0
}
func main() {
fmt.Println("vim-go")
@juanpabloaj
juanpabloaj / main.go
Last active Feb 28, 2019
show mux routes
View main.go
package main
import (
"encoding/json"
"log"
"net/http"
"github.com/gorilla/mux"
)
@juanpabloaj
juanpabloaj / .gitignore
Last active Feb 21, 2019
go api rest example
View .gitignore
*.db
api_rest
You can’t perform that action at this time.