Skip to content

Instantly share code, notes, and snippets.

View szaydel's full-sized avatar

Sam Zaydel szaydel

  • RackTop Systems
  • Moss Beach
View GitHub Profile
@szaydel
szaydel / grace.go
Created August 27, 2014 13:03 — forked from rcrowley/grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
#cloud-config
hostname: coreos-01
coreos:
etcd:
#discovery: https://discovery.etcd.io/xxxxxxxxxxxxxxxx
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.
description "Syncthing deamon"
start on (starting ufw)
stop on [!023456]
env STNORESTART=yes
env HOME=/srv/sync
respawn
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@szaydel
szaydel / 0_reuse_code.js
Created June 23, 2014 13:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#Code from http://fmota.eu/, great!
class Monoid:
def __init__(self, null, lift, op):
self.null = null
self.lift = lift
self.op = op
def fold(self, xs):
if hasattr(xs, "__fold__"):
return xs.__fold__(self)
#
# Place this code to your .profile, .bashrc, .bash_profile or whatever
#
function program_exists -d "Check if program is valid"
type "$1" &> /dev/null ;
end
function setup_goroot