Skip to content

Instantly share code, notes, and snippets.

View Aaronontheweb's full-sized avatar
🚀
Shipping!

Aaron Stannard Aaronontheweb

🚀
Shipping!
View GitHub Profile
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@Aaronontheweb
Aaronontheweb / pickup-truck-aircraft-carrier-catapult
Created February 1, 2012 07:51
How far can an aircraft carrier catapult fling a four-ton pickup truck?
How far can a pickup truck be flung off of an aircraft carrier?
333m - length of aircraft carrier deck (Nimitz Class - http://en.wikipedia.org/wiki/Aircraft_carrier)
20,411.6567 - weight of jet in kilos
2 = number of seconds a jet is active on the catapult (assume it clears all 333ms)
165mph takeoff speed = 265.54176 Km/h = 73.7616 m/s
Force = weight * (333/4) - Newton's second law of motion (F = MA | F = kg (m/s^2))
1,699,270.420 Netwons
@msluyter
msluyter / gist:1925069
Created February 27, 2012 16:22
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@Aaronontheweb
Aaronontheweb / GetLastError.cpp
Created November 14, 2013 03:45
How to format the output of Win32's GetLastError() method into a string using FormatString
DWORD dLastError = GetLastError();
LPCTSTR strErrorMessage = NULL;
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL,
dLastError,
0,
(LPWSTR) &strErrorMessage,
0,
@jboner
jboner / akka-cluster-implementation-notes.md
Last active March 4, 2023 22:30
Akka Cluster Implementation Notes

Akka Cluster Implementation Notes

Slightly disorganized but reasonably complete notes on the algorithms, strategies and optimizations of the Akka Cluster implementation. Could use a lot more links and context etc., but was just written for my own understanding. Might be expanded later.

Links to papers and talks that have inspired the implementation can be found on the 10 last pages of this presentation.

Akka Gossip

Gossip state

This is the Gossip state representation:

@Aaronontheweb
Aaronontheweb / gist:0a861d9a7a4bd9f62046
Created June 24, 2014 07:46
NinjectProps - Ninject Dependency Injection for Akka.NET actors
/// <summary>
/// Extension methods for creating <see cref="Props"/> instances that utilize Ninject
/// dependency injection.
/// </summary>
public static class NinjectProps
{
static IKernel _globalKernel;
/// <summary>
/// Sets a reference to a Ninject <seealso cref="IKernel"/> that will be used by ALL Ninject-based Props
@flcdrg
flcdrg / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@Aaronontheweb
Aaronontheweb / readme.md
Last active April 11, 2023 03:54
Building Your First Whiskey Collection

Building Your First Whiskey Collection

I got really into Scotch when I turned 30 years old and took a father-son trip through England and Scotland. Since then it's been one of my favorite hobbies and I've built a great collection over the past few years that I enjoy sharing with my friends and family.

A lot of the people in my circle have expressed interest in learning whiskey and how to build their own collection - so I put this together as a short guide to help explain how to build a tasty, diverse, and affordable "Starter Whiskey Collection." Enjoy!

A Beginner's Palette

Tasting whiskey or any hard liquor can be a challenge at first, because the alcohol flavor overwhelms the sugars, esters, and other residues from the fermentation and aging process. We want to be able to taste the stuff in the latter category without being perturbed by the former.

This guide is designed to help steer readers towards whiskeys that are easy to drink: ones with a naturally sweet or slightly berry flavor. As you start

@Aaronontheweb
Aaronontheweb / SpanHacks.cs
Last active June 2, 2021 16:46
Span<T> Hacks
/// <summary>
/// INTERNAL API.
///
/// <see cref="Span{T}"/> polyfills that should be deleted once we drop .NET Standard 2.0 support.
/// </summary>
internal static class SpanHacks
{
public static bool IsNumeric(char x)
{
return (x >= '0' && x <= '9');