Skip to content

Instantly share code, notes, and snippets.

library(ggmap)
library(readr)
data <- read_csv("./input/train.csv")
locations = c(left = -122.5222,
bottom = 37.7073,
right = -122.3481,
top = 37.8381)
@mestachs
mestachs / .bashrc
Last active December 11, 2015 16:28 — forked from btaitelb/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
@mestachs
mestachs / app.rb
Created May 4, 2013 20:37 — forked from cpatni/app.rb
require 'sinatra'
require 'redis'
require 'json'
require 'date'
class String
def &(str)
result = ''
result.force_encoding("BINARY")
// Using the Jenkins Groovy Post build plugin to execute the following after every build
// https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
// It would be nice not to have to specify these here... the repo name should be available within the hudson
// api somehow, but I didn't know how to get it. The access token should maybe be saved in a config file, and
// read in at runtime?
GITHUB_REPO_NAME = 'myusername/myreponame'
GITHUB_ACCESS_TOKEN = 'my_github_api_v3_access_token'
@mestachs
mestachs / Vagrantfile
Created July 11, 2013 09:13
Vagrantfile 1.2
require 'fileutils'
# https://gist.github.com/3798773 speed up vagrant for debian
def local_cache(box_name)
cache_dir = File.join(File.dirname(__FILE__), 'cache', 'apt', box_name)
partial_dir = File.join(cache_dir, 'partial')
FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir
cache_dir
end
@mestachs
mestachs / crypto-wrong-answers.md
Created June 19, 2016 14:42 — forked from paragonie-scott/crypto-wrong-answers.md
An Open Letter to Developers Everywhere (About Cryptography)
@mestachs
mestachs / punch_card.rb
Created January 26, 2017 19:33
punch card
require 'histogram/array'
require 'active_support'
require 'active_support/core_ext'
require 'active_support/core_ext/numeric'
timestamps = (1..355).map do |t|
[
Time.now + (t * 1).days + 3.hours + rand(60).minutes + rand(16).seconds,
Time.now + (t * 1).days - 1.hours + rand(60).minutes + rand(16).seconds
]
@mestachs
mestachs / problem.json
Created January 8, 2018 15:02
problem.json
{
"act1_weight_level1_for_1_and_2016q1": "6",
"act1_achieved_for_1_and_2016q1": "33",
"act1_target_for_1_and_2016q1": "33",
"act1_active_for_1_and_2016q1": "1",
"act1_cap_level1_for_1_and_2016q1": "125",
"act1_regional_bonus_level1_for_1_and_2016q1": "121235",
"act1_orgunit_id_for_1_and_2016q1": "1",
"act2_weight_level1_for_1_and_2016q1": "5",
"act2_achieved_for_1_and_2016q1": "80",
Orgunits*
type -> OrgunitsFetching
tick -> Periods
OrgunitsFetching
type -> Orgunits
Periods
tick -> ReferencePeriods