Skip to content

Instantly share code, notes, and snippets.

@apoloval
apoloval / vagrant-scp
Created October 23, 2015 09:45
Upload files to a Vagrant box using scp
#!/bin/sh
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} "$@" || echo "Transfer failed. Did you use 'default:' as the target?"
@apoloval
apoloval / guessing.rs
Created February 24, 2015 08:36
A number guessing kata implemented in Rust
use std::cmp::Ordering;
use std::io;
use std::os;
use std::rand;
static PICK_RANGE: u32 = 5;
enum Command { Pick, Guess }
fn parse_command(from: &str) -> Option<Command> {
@apoloval
apoloval / aena-charts.py
Created April 27, 2014 10:12
A Python script to download the navigation charts for all spanish airports from Aena website. It requires BeautifulSoup4 installed in your system.
import os, errno, urllib2
from bs4 import BeautifulSoup
BASE_URL = "http://www.aena.es/csee/Satellite/navegacion-aerea/es/Page/1078418725163/?other=1083158950596#ancla3"
DEFAULT_RETRIES = 3
def leaf_open_list(soup):
if not soup:
return None
r1 = soup.find("li", class_="listOpened")