Skip to content

Instantly share code, notes, and snippets.

View GeneralistDev's full-sized avatar
🏠
Working from home

Daniel Parker GeneralistDev

🏠
Working from home
View GitHub Profile
@troyfontaine
troyfontaine / 1-setup.md
Last active December 1, 2025 15:11
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@darahayes
darahayes / ansible_kms_encrypt_decrypt.md
Last active February 18, 2024 18:57
KMS Encrypt and Decrypt filters in Ansible

KMS Encrypt and Decrypt Filters for Ansible

This Gist shows how you can encrypt/decrypt variables with KMS during your Ansible playbook execution. While google searching I couldn't find anything useful on the subject.

Let's say your project has a folder of playbooks called plays.

In that folder, create a folder called filter_plugins and insert kms_filters.py (included in this gist)

@GeneralistDev
GeneralistDev / correlation_id search
Created October 20, 2016 03:52
Sumologic correlationid search
@shiftkey
shiftkey / cliff-notes.md
Last active July 28, 2018 22:20
Working Distributed - Cliff Notes
@worldspawn
worldspawn / Order.cs
Last active February 29, 2016 05:11
Order a queryable based on a string input. "Members" can be a value like: "Name, Company.Type desc, Company.Name". Handles nested property references, ascending/descending and nullable/nonnullable targets.
private IQueryable<T> Order<T>(IQueryable<T> list, string members)
{
var param = Expression.Parameter(list.ElementType, "r");
bool thenMode = false;
foreach (var member in members.Split(','))
{
MemberExpression memberExpression = null;
var chop = member.Split(' ');
foreach (var memberPart in chop[0].Split('.'))
@bobjflong
bobjflong / index.js
Last active December 19, 2017 18:30
Conversations Tags Demo
var PromiseThrottle = require('promise-throttle');
var wait = require('waitress');
var Intercom = require('intercom-client');
var intercomClient = new Intercom.Client("app id", "api key").usePromises();
var redis = require('redis');
var client = redis.createClient()
var _ = require('underscore');
var fetchConversation = function (id) {
return function () {
@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active May 16, 2024 03:29
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@GianlucaGuarini
GianlucaGuarini / post-merge
Last active February 13, 2025 13:38 — forked from sindresorhus/post-merge
Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency using bower npm or composer
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# forked by Gianluca Guarini
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
}
@mbseid
mbseid / AbstractDAO.java
Created August 16, 2012 17:25
Using Ebean with Play! Framework 2
package daos;
import java.util.*;
import javax.persistence.*;
import play.*;
import play.db.ebean.*;
import play.db.ebean.Model.*;
import play.data.format.*;
import play.data.validation.*;
@EmilHernvall
EmilHernvall / data2sound.py
Created September 29, 2011 14:07
Encode data as sound, and retrieve it using a FFT
class GlobalFormat(object):
def __init__(self):
self.id = 0x46464952 # RIFF
self.size = 0
self.type = 0x45564157 # WAVE
def as_bin(self):
return struct.pack("III", self.id, self.size, self.type)