Skip to content

Instantly share code, notes, and snippets.

@waltherg
waltherg / dump-restore
Created January 21, 2021 09:34 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@waltherg
waltherg / bayes_hypotheses.js
Last active November 19, 2017 19:28
Bayesian Hypothesis Testing
function Pmf(domain){
this.domain = {}
for(var i = 0; i < domain.length; i++){
value = domain[i][0];
probability = domain[i][1];
this.domain[value] = probability;
}
}
@waltherg
waltherg / slack.py
Created October 4, 2016 18:37 — forked from boxysean/slack.py
PythonSlackOperator -- how I've integrated notifications into my PythonOperators
# airflow/plugins/slack.py
import logging
from airflow.operators.python_operator import PythonOperator
from airflow.plugins_manager import AirflowPlugin
from slackclient import SlackClient
from titan.utils import config
@waltherg
waltherg / foo_names.md
Created July 10, 2016 08:05 — forked from mihaitodor/foo_names.md
Map slugs to course names

https://archive.org/download/archiveteam_coursera_20160627114043/coursera_20160627114043.megawarc.warc.gz

  • bigdata = Web Intelligence and Big Data
  • clinical skills = Teaching and Assessing Clinical Skills
  • comp finance = Introduction to Computational Finance and Financial Econometrics
  • data sci = Introduction to Data Science
  • dmathgen = 离散数学概论 Discrete Mathematics Generality
  • global introuslaw = The Global Student's Introduction to U.S. Law
  • global theatre = Theatre and Globalization
  • global theatre = Theatre and Globalization
  • inforiskman = Information Security and Risk Management in Context
@waltherg
waltherg / query_test.sql
Last active March 4, 2016 20:45
Postgresql query test
CREATE SCHEMA IF NOT EXISTS my_test;
DROP TABLE IF EXISTS my_test.my_table;
DROP TABLE IF EXISTS my_test.a_table CASCADE;
DROP TABLE IF EXISTS my_test.a_b_relation;
CREATE TABLE my_test.my_table (
a integer,
b integer
);
alert("test")
require 'formula'
<<-COMMENTS
This is the Homebrew formula for Python.
Versions
--------
This formula is currently tracking version 2.6.x.
@waltherg
waltherg / plos_time_to_publication.ipynb
Last active December 24, 2015 20:48
PLoS Time to Publication
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@waltherg
waltherg / editors_plos_one_dates_numbered.dat
Last active December 23, 2015 13:49
PLoS ONE Citation Counts pulled from CrossRef OpenURL
This file has been truncated, but you can view the full file.