Skip to content

Instantly share code, notes, and snippets.

View vindir's full-sized avatar
🧰

Jamey Owens vindir

🧰
View GitHub Profile
@vindir
vindir / gen.swift
Created November 16, 2016 04:32 — forked from blainerothrock/gen.swift
A Very Simple Genetic Algorithm Written in Swift 3
#!/usr/bin/env xcrun swift -O
/*
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3
-------------------- https://gist.github.com/cfdrake/973505 ---------------------
gen.swift implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
The parameters of the simulation can be changed by modifying one of the many
@vindir
vindir / HaProxy Circuit Breaker
Created November 14, 2016 20:42
HaProxy circuit-breaker-like setup
frontend my_frontend
bind *:443
acl is_my_frontend hdr(host) -i my_frontend.company.com
use_backend my_backend_cluster if is_my_frontend
backend my_frontend_cluster
balance roundrobin
option httpchk GET /health
default-server error-limit 3 on-error mark-down
server 192.168.10.1 weight 1 observe layer7
@vindir
vindir / context.xml
Last active November 8, 2016 15:28
Dump Tomcat Sessions Between Restarts
<Manager pathname="">
<saveOnRestart>false</saveOnRestart>
</Manager>
// Alternatively on Tomcat7
<Manager pathname="" />
@vindir
vindir / Python Drop to Interpreter
Last active November 10, 2016 15:37
Python Drop to Interpreter
import code
code.interact(local=dict(globals(), **locals()))
from IPython import embed
embed()
@vindir
vindir / amazon-id.conf
Created July 29, 2016 02:25 — forked from schlomo/amazon-id.conf
Amazon ID plugin for YUM. This will add 2 headers to the HTTP requests. With these headers the YUM repo server can identify the EC2 instance. These files come from the rh-amazon-rhui-client RPM package found on RHEL EC2 instances, probably part of the Red Hat Update Infrastructure (https://access.redhat.com/products/red-hat-update-infrastructure/)…
[main]
enabled=1
@vindir
vindir / install-pre-commit.sh
Created October 13, 2015 18:57 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@vindir
vindir / mandelbrot.sql
Last active August 29, 2015 14:25 — forked from rupey/mandelbrot.sql
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
  1. General Background and Overview

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.