View bitbucket-pipeline.yml
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
image: python:3.8 | |
pipelines: | |
# Continuous Integration pipeline | |
pull-requests: | |
'**': # run on any branch | |
- step: | |
name: Set up and build | |
caches: | |
- pip |
View _test.py
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
# A proof of concept for implementing re-usable nested rules in Dragonfly. | |
# | |
# See http://simon.podhajsky.net/blog/2017/executing-nested-rules-with-dragonfly/ | |
# for the accompanying article. | |
try: | |
import pkg_resources | |
pkg_resources.require("dragonfly >= 0.6.5beta1.dev-r99") | |
except ImportError: | |
pass |
View Vundle bug replication
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
#!/usr/bin/env bash | |
# A script to replicate VundleVim/Vundle.vim/issues/807 | |
## Setup | |
cd /tmp | |
rm -rf bugtest | |
mkdir bugtest && cd bugtest && git init | |
git submodule add -b vundle_bug https://github.com/shippy/dotvim.git dotvim | |
git submodule update --init --recursive | |
hook_path=".git/modules/dotvim/hooks/post-checkout" |
View 1-downloadFromGH.rb
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
require 'pry' | |
require 'octokit' | |
require 'json' | |
# Part 0: Extract bare repo and push it to GH: | |
# Follow https://help.github.com/enterprise/2.2/admin/articles/moving-a-repository-from-github-com-to-github-enterprise/ | |
# Part 1: Extract issues & everything else from the source repo | |
## Setup | |
Octokit.configure do |c| |
View GelmanCup.r
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
## Dependencies (get them with `install.packages(c("dplyr", "ggplot2", "ggthemes"))`) | |
library(dplyr) | |
library(ggplot2) | |
library(ggthemes) | |
options(repr.plot.width = 8, repr.plot.height = 5) # Default figure size | |
## Load + process data | |
x <- read.csv("gelman_cup_graphic_reporting_challenge_data.csv") |
View foursquare-parser.py
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
# The output of the script is meant to be piped to an output csv file. | |
# Usage: | |
# python foursquare-parse.py > foursquare.csv | |
import xml.etree.ElementTree as ET | |
from dateutil import parser | |
from datetime import * | |
tree = ET.parse('foursquare.kml') # or whatever the kml file is called | |
root = tree.getroot() |
View crawler.py
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
# Crawls results scraped by scrape.sh; saves resulting nodes and edges into pickles. | |
import pickle | |
import urlparse | |
from objects import * | |
import pdb | |
nodes = [] | |
edges = [] |
View volby13-gdp.r
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
library(XML) | |
reg_gdp_url <- "http://en.wikipedia.org/wiki/Regions_of_the_Czech_Republic" | |
reg_gdp <- readHTMLTable(reg_gdp_url, encoding = "UTF-8") | |
reg_gdp[[2]][1:14,2] -> regions | |
as.numeric(gsub(",", "", as.character(reg_gdp[[2]][1:14,8]))) -> GDP | |
nuts <- c(1100, 2100, 3100, 3200, 4100, 4200, 5100, 5200, 5300, 6200, 8100, 7100, 7200, 6100) |