Skip to content

Instantly share code, notes, and snippets.

View tima's full-sized avatar

Timothy Appnel tima

View GitHub Profile
@pragdave
pragdave / ansible_logging.py
Last active December 9, 2016 03:56
Logging plugin for Ansible
# Interpret the Ansible log for humans. In particular, we
# look for command executions and format their content
#
# - name: list files
# shell: "ls -lrt *e*"
#
# Might produce
#
# TASK: [1] ***********************************************************
# changed: [localhost]
@phips
phips / hasetup.yml
Last active September 11, 2017 17:56
Tower HA pre-run
---
# vim: set ft=ansible sw=2 ts=2 et:
#
# Prepare for Tower HA install
#
#* Download offline bundle
#* Unarchive offline bundle on ALL hosts
#* do ./bundle_setup.sh on ALL hosts
#* do pre-dependency installs [yum install -y $(cat required_os_packages.txt)] on PRIMARY host
#
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@nijikokun
nijikokun / example-user.js
Created May 3, 2012 20:46
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@ryangray
ryangray / buttondown.css
Created February 22, 2012 06:45
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
#!/usr/bin/perl
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs
# License: See below.
# http://gist.github.com/507356
use strict;
use warnings;
use URI::Escape;