Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Spawns a rescue worker configured according to local hostname.
# See the 'case'-block at the end of this file.
#
# make sure we have our environment
source ~/.bash_profile
@fredv
fredv / gist:2035960
Created March 14, 2012 11:45
Collected Ideas on OOP and Software Design as of now
Collected Ideas on OOP and Software Design as of now
Just One Idea (Jeff Casimir et. al.)
Application - ONE value proposition (monolithic is crappy)
Module - collection of ideas
Class - one domain
Method - one purpose
Line - one thought
Clarity over brevity: (Jeff Casimir et. al.)
@fredv
fredv / gist:3098462
Created July 12, 2012 14:30
Solr instrumentation for Supernova after Michael Nutt
module SolrInstrumentation
class LogSubscriber < ActiveSupport::LogSubscriber
def query(event)
self.class.runtime += event.duration
return unless logger.debug?
name = '%s (%.1fms)' % ["SOLR Query", event.duration]
# produces: 'query: "foo" OR "bar", rows: 3, ...'
query = event.payload[:query].map{ |k, v| "#{k}: #{color(v, BOLD, true)}" }.join(', ')

Keybase proof

I hereby claim:

  • I am fredv on github.
  • I am frederik (https://keybase.io/frederik) on keybase.
  • I have a public key whose fingerprint is 61C1 D425 AEE0 42F6 5C4D 3060 038B 40D5 2F87 1B99

To claim this, I am signing this object:

import (
"github.com/dynport/urknall"
"github.com/dynport/urknall/cmd"
)
func helloWorld (p urknall.Package) {
p.AddCommands("run", cmd.Shell("echo hello world"));
}
func main() {
@fredv
fredv / vimux.md
Last active July 5, 2021 10:15
Vimux Start
@fredv
fredv / ES_quoted_query_not_analyzed
Created July 23, 2014 09:22
ElasticSearch query_string parsing quotes on not_analyzed field vs. standard tokenizer
PUT http://localhost:9200/_template/txt
{
"template": "index_dev",
"order": 0,
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template_txt": {
"mapping": {
@fredv
fredv / .vimrc
Created November 26, 2015 17:17
.vimrc
filetype plugin off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'tpope/vim-fugitive'
Plugin 'rking/ag.vim'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'Rip-Rip/clang_complete'
@fredv
fredv / .tmux.conf
Created November 26, 2015 17:17
.tmux.conf
#ChrisJohnson/tmux-MacOSX-pasteboard
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g repeat-time 1000
set -s escape-time 1
set -g base-index 1
set -g pane-base-index 1
set-option -g prefix C-a
set-option -g history-limit 10000
@fredv
fredv / Some Japanese and Chinese (Business) Terminology.md
Last active May 9, 2016 16:22
Some notes I took from a presentation of Rochelle Kopp at LocWorld Tokyo

Japanese

Kanji / Hiragana / Romaji

無駄 (むだ) Muda

Waste

安定 (あんてい) Antei

Stability; Predictability