Skip to content

Instantly share code, notes, and snippets.

View patrickjahns's full-sized avatar

Patrick Jahns patrickjahns

View GitHub Profile
@Ocramius
Ocramius / MyModule\AbstractRepositoryFactory.php
Last active October 21, 2017 12:54
A simple way to map all Doctrine Entity repositories as Services without defining them manually
<?php
namespace MyModule;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Doctrine\Common\Persistence\ObjectManager;
class AbstractRepositoryFactory implements AbstractFactoryInterface
{
@natelandau
natelandau / .bash_profile
Last active June 13, 2024 18:01
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@blakev
blakev / ssh_util.py
Last active May 1, 2019 15:21
Paramiko SSHClient Abstraction, includes batch commands and stdin
# Paramiko SSH Object with batch commands and stdin
# Blake VandeMerwe July 2014
#
# Adapted from Joe Linoff's code at http://joelinoff.com/blog/?p=905
# his did not work for me, so I fixed it and added some features.
#
import re
import string
import logging
import socket
@mbbx6spp
mbbx6spp / README.md
Last active May 28, 2024 13:52
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
@kjbrum
kjbrum / bash_profile.sh
Last active June 14, 2024 19:58
My personal bash profile
#---------------------------------------------------------------------------------------------------------------------------------------
#
# Author: Kyle Brumm
# Description: File used to hold Bash configuration, aliases, functions, completions, etc...
#
# Sections:
# 1. ENVIRONMENT SETUP
# 2. MAKE TERMINAL BETTER
# 3. FOLDER MANAGEMENT
# 4. MISC ALIAS'
@colinvh
colinvh / aws.md
Last active June 28, 2024 20:32
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active April 21, 2024 04:22
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown: