Skip to content

Instantly share code, notes, and snippets.

View andrewfinnell's full-sized avatar

Andrew T. Finnell andrewfinnell

View GitHub Profile
@jimeh
jimeh / .gitignore
Created December 24, 2009 11:51
A quick head-to-head performance test of JSON vs. BSON.
.DS_Store
data.rb
results.txt
@jamarparris
jamarparris / Generate Mongo Object ID in PostGres
Last active April 1, 2025 13:43
Create ObjectIds in PostGres following the MongoDB semantics. Very similar to the Instagram approach linked below.http://docs.mongodb.org/manual/reference/object-id/http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@shawndumas
shawndumas / .gitconfig
Created August 5, 2013 19:08
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
using System;
using System.Collections.Generic;
using System.Linq;
namespace Voron.Util
{
/// <summary>
/// A list that can be used by readers as a true immutable read-only list
/// and that supports relatively efficient "append to the end" and "remove
/// from the front" operations, by sharing the underlying array whenever
var path = require('path')
var childProcess = require('child_process')
var phantomjs = require('phantomjs')
var nodemailer = require("nodemailer");
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "br****@gmail.com",
@orderedlist
orderedlist / .gitconfig
Created June 23, 2015 17:54
Alases for .gitconfig
[alias]
unstage = reset HEAD --
undo = reset --soft HEAD~1
drop-old-stashes = reflog expire --expire=30.days refs/stash
up = pull --rebase --prune
@gene1wood
gene1wood / 01_setup_lets_encrypt.sh
Last active June 9, 2021 19:57
Example of how to setup Let's Encrypt on RHEL / CentOS and automate certificate rewnewal
#!/bin/bash
[email protected]
DOMAINS=example.com,www.example.com,foo.example.com,example.org.example.net,www.example.org,www.example.net
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt/
mkdir -p /var/lib/letsencrypt/global-webroot
# Setup the global alias
@andrewfinnell
andrewfinnell / generate_object_id.sql
Last active April 7, 2018 23:01
NoSQL-like Unique Identifiers in SQL
-- This file is released under the MIT License (MIT)
--
-- Copyright (c) 2013 Jamar Parris
-- Copyright (c) 2016 Andrew T. Finnell <[email protected]>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-- documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
-- and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
--
@andrewfinnell
andrewfinnell / faux-react-dom.js
Created May 9, 2017 21:00
A React UI Renderer that will create DOM elements immediately instead of going through the react engine. Useful for testing Web Component style widgets.
(function (global) {
var FauxElement = function (tagName) {
this.id = "";
this.tagName = tagName;
this.attributes = {};
this.children = [];
this.lastChild = null;
this.firstChild = null;
};
@andrewfinnell
andrewfinnell / .gitconfig
Created June 18, 2017 18:20 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge