Skip to content

Instantly share code, notes, and snippets.

@agonzalezro
agonzalezro / spacemacs_key_bindings.md
Last active December 10, 2021 16:39
Interesting spacemacs keys that I should remember
  • SPC h
  • SPC ?: search keybinding
  • SPC f e h: help about current layer
  • SPC T h: themes
  • SPC m g g: go to definition
  • SPC m t [p|P|s|t]: run tests
  • SPC a k: launch paradox (package manager)
  • SPC t -: lock the cursor at the center of the screen
  • SPC SPC a: avy word search
  • SPC w =: balance split windows
@agonzalezro
agonzalezro / bulk-neo4j-import-original.sh
Created May 11, 2016 20:22 — forked from jexp/bulk-neo4j-import-original.sh
Panama Papers Import Scripts for Neo4j and Docker
export NEO4J_HOME=${NEO4J_HOME-~/Downloads/neo4j-community-3.0.1}
if [ ! -f data-csv.zip ]; then
curl -OL https://cloudfront-files-1.publicintegrity.org/offshoreleaks/data-csv.zip
fi
export DATA=${PWD}/import
rm -rf $DATA
#!/bin/bash -x
set -euo pipefail
@agonzalezro
agonzalezro / watchers.go
Last active July 14, 2017 09:30
go run watchers.go -kubeconfig ~/.kube/config
package main
import (
"flag"
"fmt"
"log"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/watch"
package main
import (
"bytes"
"fmt"
"os"
"github.com/fsouza/go-dockerclient"
)

Change the number of REPLICAS to make it easier or harder.

demo

$ bash game.sh
I have launched 2 Pods in a Replica Set, are you quicker eliminating
them than Kubernetes recreating them? Let's see!
#!/bin/bash
image=$(mktemp)
gophers=$(http http://gopherize.me/gophers/recent/json|jq '.gophers')
length=$(echo $gophers|jq '. | length')
random=$(jot -r 1 1 $(($length-1)))
url=$(echo $gophers|jq ".[$random].url"|tr -d \")
http --output $image $url
convert $image -background white -flatten gopher.jpeg
hash: 26d5b8a8318cdb9b411e542057344c2142c5bd93d2a9b8962fb49188a5db0b65
updated: 2017-10-01T19:57:23.106136898+02:00
imports:
- name: github.com/gorilla/mux
version: 24fca303ac6da784b9e8269f724ddeb0b2eea5e7
- name: github.com/stretchr/testify
version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0
testImports: []