Skip to content

Instantly share code, notes, and snippets.

View jdandrea's full-sized avatar

Ashley D'Andrea jdandrea

  • Red Hat
  • Basking Ridge, NJ
  • 00:25 (UTC -04:00)
View GitHub Profile
@chrishulbert
chrishulbert / curvisview.m
Created May 25, 2011 05:00
Finding the currently visible view in a UITabBarController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Firstly, we want to figure out who is the currently visible view controller.
// There are 4 possibilities here:
// 1- They could be a non-nav controller, with a visible tab (ie not under the 'more' tab)
// Simple: self.selectedViewController
// 2- They could be a nav controller, with a visible tab (ie not under the 'more' tab)
// Get it's visible view: self.selectedViewController.visibleViewController
// 3- They could be a non-nav controller, under the 'more' tab
// Simple: self.selectedViewController
// 4- They could be a nav controller, under the 'more' tab
@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
@swinton
swinton / upstart_virtualenv_test.conf
Created March 5, 2012 15:44
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@ShawnMilo
ShawnMilo / validate_uuid4.py
Created December 3, 2013 20:55
Validating a uuid4 with Python.
from uuid import UUID
def validate_uuid4(uuid_string):
"""
Validate that a UUID string is in
fact a valid uuid4.
Happily, the uuid module does the actual
checking for us.
@RichardBronosky
RichardBronosky / AddSSHKeysAtLogin.plist
Last active June 2, 2024 04:50
Launch ssh-agent on boot (OSX macos)
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-add-a</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh-add</string>
<string>-A</string>
</array>
<key>StandardOutPath</key>
@slavafomin
slavafomin / git-submodules.md
Last active February 19, 2025 03:15
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive [email protected]:name/repo.git

— Initialize submodules after regular cloning:

@ekreutz
ekreutz / ansible_variable_precedence.md
Last active May 28, 2025 08:13
Ansible variable precedence (order, hierarchy)
@egernst
egernst / dockerbehindproxy.md
Created March 26, 2018 18:56
Popular ways I fail with docker behind proxy

Getting Docker working well behind Proxy on Ubuntu

Docker's runtime config setup:

$ cat ~/.docker/config.json 
{
	"proxies":
	{
 "default":
@ryran
ryran / ocpv4-expired-cert-recovery.sh
Created June 10, 2019 21:19
OCPv4: recover from expired control plane certificates
#!/bin/bash
#
# This extremely rough nonsense is an attempt to automate the disaster recovery
# expired certs documentation published at
# https://docs.openshift.com/container-platform/4.1/disaster_recovery/scenario-3-expired-certs.html
# ... Which was last reviewed on 2019/06/10
#
# Please contact [email protected] with suggestions or corrections
# CUSTOMIZE THESE: