Skip to content

Instantly share code, notes, and snippets.

@mikesouza
mikesouza / lifecycle-plugin.js
Created February 20, 2019 11:11 — forked from bwinant/lifecycle-plugin.js
Serverless Plugin Lifecycle Events
'use strict';
// This plugin will bind to all available lifecycle events and print them out as they are invoked
class LifecyclePrinter {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = this.serverless.getProvider('aws');
@mikesouza
mikesouza / binds_on_mount.sh
Created August 12, 2018 15:31 — forked from alexandrusavin/binds_on_mount.sh
Add letsencrypt certificate to dd-wrt web interface
#!/bin/sh
if [ `nvram get https_enable` -gt 0 ] ; then
# get the absolute directory of the executable
SELF_PATH=$(cd -P "$(dirname "$0")" && pwd -P)
echo SELF_PATH: ${SELF_PATH}
# extract the mount path
@mikesouza
mikesouza / sshpass.rb
Last active April 20, 2017 18:00
SSHPass Homebrew Formula
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
@mikesouza
mikesouza / stooge_loader.rb
Created May 12, 2016 11:17 — forked from bowsersenior/stooge_loader.rb
A demo of YAML anchors, references and nested values
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
# ---------------------------------------------------------------------------
#
# 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
@mikesouza
mikesouza / RedundantMethod.cs
Created September 5, 2011 19:07
The Redundant Method
/// <summary>
/// Returns an array of the names in the specified enumeration.
/// </summary>
/// <param name="pEnumerationType">The enumeration to retrieve the names
/// from.</param>
/// <returns>Returns an array of the names in the enumeration.</returns>
private static string[] GetNames(Type pEnumerationType)
{
// TODO: Move this function to the EnumUtil class in the
// Managers.Utilities project and make it public.