Skip to content

Instantly share code, notes, and snippets.

@ricjcosme
ricjcosme / dump-restore
Created Sep 13, 2017
DUMP / RESTORE PostgreSQL Kubernetes
View dump-restore
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
@azproduction
azproduction / LICENSE.txt
Created Nov 28, 2011 — forked from 140bytes/LICENSE.txt
A turing machine in 79! bytes of javascript
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@groovybayo
groovybayo / step-by-step-gatling-idea.md
Last active Nov 30, 2021
Gatling: Step by step guide to IntelliJ integration
View step-by-step-gatling-idea.md

Step by step guide to setting up IDEA to write gatling simulations

Prerequisites:

Have [SBT plugin][sbt-plugin] installed

Begin

  • [Create a new project][create-project] in IDEA ( File > New Project ...)
    • Make sure you select a maven module
@andlima
andlima / gist:1774060
Created Feb 8, 2012
Median of medians selection algorithm
View gist:1774060
int find_kth(int *v, int n, int k) {
if (n == 1 && k == 0) return v[0];
int m = (n + 4)/5;
int *medians = new int[m];
for (int i=0; i<m; i++) {
if (5*i + 4 < n) {
int *w = v + 5*i;
for (int j0=0; j0<3; j0++) {
int jmin = j0;