Skip to content

Instantly share code, notes, and snippets.

@ronan-mch
ronan-mch / check_k8s_secrets.rb
Created September 3, 2018 08:33
Check K8s secrets synchronisation
require 'yaml'
puts "Checking Kubernetes templates for annotation mismatches..."
blacklist = %w(kubernetes/app_server.yml kubernetes/console.yml)
templates = Dir.glob("kubernetes/*.yml") - blacklist
template_vars = {}
reference_vars = []
errors = []
@ronan-mch
ronan-mch / fields.csv
Created March 21, 2017 14:01
Replace fields with methods
alert_timestamp alert_timestamp_dt
update_timestamp update_timestamp_dt
format format
subformat subformat_s
superformat superformat_s
format_orig format_orig_s
cluster_ids cluster_id_ss
pub_date pub_date_tis
pub_date_sort pub_date_tsort
titles title_ts
@ronan-mch
ronan-mch / reading_list.md
Last active March 12, 2017 12:23
Reading List

Digital Humanities

  • Computing and Visualizing the 19th-Century Literary Genome, Jockers, Matthew
  • Content analysis of 150 years of British periodicals, doi: 10.1073/pnas.1606380114
  • Quantitative Analysis of Culture Using Millions of Digitized Books DOI: 10.1126/science.1199644
  • Mass digitization and the garbage dump: The conflicting needs of quantitative and qualitative methods
  • Mining semantics for culturomics: Towards a knowledge-based approach
  • Quantitative Analysis and Literary Studies
  • Probabilistic Topic Decomposition of an Eighteenth-Century American Newspaper
@ronan-mch
ronan-mch / .vimrc
Created September 12, 2016 19:55
Vim configuration
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@ronan-mch
ronan-mch / plot.py
Last active September 2, 2016 11:02
Solr Stress test
import csv
import pandas
from ggplot import *
import numpy
response_vals = []
with open('report.csv', 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=';')
for row in reader:
response_vals.append(float(row[0]))
require 'nokogiri'
require 'net/http'
require 'colorize'
require 'open-uri'
require 'zlib'
class SitemapCheck
def initialize(basemap)
@root_target = basemap
@log = 'sitemap.log'
var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
return this.sideLength * 4;
};
// help us define an area method here
square.calcArea = function(){
return this.sideLength * this.sideLength;
};
var p = square.calcPerimeter();
@ronan-mch
ronan-mch / fizzbuzz.exs
Created October 21, 2015 10:16
Elixir FizzBuzz
defmodule FizzBuzz do
def write(i) when (rem(i, 3) == 0 and rem(i, 5) == 0) do
IO.puts "FizzBuzz"
end
def write(i) when rem(i, 3) == 0 do
IO.puts "Fizz"
end
def write(i) when rem(i, 5) == 0 do
@ronan-mch
ronan-mch / sofia.html
Last active October 20, 2015 19:37
Helping Sofia with javascript problems
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Sofia's javascript playground</title>
<style>
h1 {