Skip to content

Instantly share code, notes, and snippets.

View jarrettmeyer's full-sized avatar

Jarrett Meyer jarrettmeyer

View GitHub Profile
@shortjared
shortjared / list.txt
Last active May 10, 2024 19:49
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@jarrettmeyer
jarrettmeyer / Enable_OLE_Automation.sql
Last active April 6, 2024 07:42
Demonstrates how to send an HTTP request with SQL Server using OLE Automation.
EXEC sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
anonymous
anonymous / gist:4545932
Created January 16, 2013 09:42
Compare two ways to do the same validation. In both cases, the values for `StartTime` and `EndTime` are strings in the view models, hence the reason they need to be parsed at the beginning of the method.
// First version
// 1. Multiple return statements (> cyclomatic complexity)
// 2. 'Happy' path comes first
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var startTime = TimeSpan.Parse(StartTime);
var endTime = TimeSpan.Parse(EndTime);
if (startTime < endTime)
return new ValidationResult[] { };
@imathis
imathis / gist:2788340
Created May 25, 2012 14:10
Automated Drafts in Octopress

Why I don't like automated time delayed publishing of drafts in Octopress:

  1. It's not hard to publish a draft when you want to.
  2. It may be hard to set up due to development environment issues.
  3. There are lots of edge cases that aren't obvious at first. Supporting this won't be easy.
  4. People could accidentally push a broken site.

Example

You're working on a plugin for Octopress and your task timer goes off. Your blog just starts generating and deploying in the background but you're in a development branch working on some feature. Result: your script generates your test site, but not your blog, and pushes it live in the background.

@jarrettmeyer
jarrettmeyer / Rakefile
Created May 24, 2012 21:28
Octopress publish drafts
require "rubygems"
require "date"
# Configuration
base_dir = Dir.pwd
blog_dir = "#{base_dir}/blog"
source_dir = "#{blog_dir}/source"
posts_dir = "#{source_dir}/_posts"
git_remote = "origin"
git_branch = "master"
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@jarrettmeyer
jarrettmeyer / jquery.buildSelectList.js
Created December 6, 2010 15:01
jQuery buildSelectList plugin
(function ($) {
$.fn.buildSelectList = function (options) {
defaults = {
url: null, // URL for the select list options.
data: null, // Data to be passed to the URL.
value: null, // Currently selected option value.
valueProperty: "value", // JSON property for option value.
textProperty: "text", // JSON property for option text.
type: "GET", // JSON HTTP method.
useCache: false, // Allow outputs to be cached.