Skip to content

Instantly share code, notes, and snippets.

View JeanMertz's full-sized avatar

Jean Mertz JeanMertz

View GitHub Profile
@JeanMertz
JeanMertz / syntax_highlighting.py
Created April 18, 2011 08:39
Ruby on Rails syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Detects current file type if the file's extension isn't conclusive """
""" Modified for Ruby on Rails and Sublime Text 2 """
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """
def on_load(self, view):
filename = view.file_name()
@JeanMertz
JeanMertz / result
Last active February 17, 2021 14:20
./target/debug/vector -q --config test.toml
{"bar":2}
{"foo":1}
{"baz":3}
{"foo":1}
{"bar":2}
{"baz":3}
{"bar":2}
{"foo":1}
{"baz":3}
@JeanMertz
JeanMertz / result
Last active February 17, 2021 09:35
./target/debug/vector -q --config vector.toml
{"foo":true}
{"bar":true}
@JeanMertz
JeanMertz / chruby.sh
Last active September 9, 2020 21:03
Snippets for article "debian + chruby + postgres + nginx + unicorn + rails and friends…"
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby 2 &>/dev/null
if [ "$?" -eq "1" ]
then
chruby 1 &>/dev/null
fi
#![warn(
unused,
unused_import_braces,
unused_lifetimes,
unused_qualifications,
unused_results,
)]
#![forbid(
unsafe_code,
future_incompatible,
@JeanMertz
JeanMertz / main.go
Last active August 20, 2017 21:49
Automated Kubernetes Google Cloud Platform routes
package main
import (
"fmt"
"log"
"time"
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
compute "google.golang.org/api/compute/v1"
# apiVersion defines the version of the charts.yaml structure. Currently,
# only "v1" is supported.
apiVersion: v1
# name is the .Release.Name template value that charts can use in their
# templates, which can be overridden by the "--name" CLI flag. If omitted,
# "--name" is required.
name: my-bundled-apps
---
hello: world
#!/bin/bash
#
# This file is managed by Chef, using the <%= node.name %> cookbook.
# Editing this file by hand is highly discouraged!
#
# Copyright (c) 2014 Jean Mertz <jean@mertz.fm>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#!/bin/bash
source /etc/environment
name=$(cat /etc/machine-id)
if [ ! -f /opt/consul ]; then
mkdir /opt
mkdir /var/lib/consul
wget https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip
unzip 0.4.1_linux_amd64.zip