Skip to content

Instantly share code, notes, and snippets.

View adback03's full-sized avatar

Andrew Backes adback03

View GitHub Profile
@adback03
adback03 / new_task.py
Created April 29, 2021 22:39 — forked from reedsa/new_task.py
RabbitMQ Retry using Dead Letter Exchange in Python/Pika
#!/usr/bin/env python
# http://www.rabbitmq.com/tutorials/tutorial-two-python.html
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
message = ' '.join(sys.argv[1:]) or "Hello World!"
@adback03
adback03 / tasks.json
Created December 10, 2016 04:58
Sample tasks.json with multiple commands
{
"version": "0.1.0",
"windows": {
"command": "cmd",
"args": [
"/C"
],
"isShellCommand": true
},
"linux": {
@adback03
adback03 / print_standard_legal_bfz_soi.py
Created August 7, 2016 00:10
Print all standard legal cards in Battle for Zendikar and Shadows over Innistrad blocks
@adback03
adback03 / policy.json
Created February 12, 2016 06:30
Amazon S3 Bucket Policy for Ghost-s3
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "arn:aws:s3:::*"
},
{
"card":{
"name":"Narset, Enlightened Master",
"manaCost":"{3}{U}{R}{W}",
"cmc":6,
"colors":[
"White",
"Blue",
"Red"
],
@adback03
adback03 / Rakefile
Last active March 29, 2016 02:04
Sample usage and an Example application for the MTG SDK for Ruby
# Rakefile
require_relative 'sample_application'
task :run do
SampleApplication.load_legendary_cards
end
require 'mtg_sdk'
def get_all_cards
page = 1
cards = []
cards << MTG::Card.where(page: page).get
while true
results = MTG::Card.where(page: page += 1).get
results.empty? ? break : cards.concat(results)
@adback03
adback03 / all_cards.json
Last active January 20, 2016 17:12
JSON responses for MTG API
{
"cards": [
{
"name": "Air Elemental",
"manaCost": "{3}{U}{U}",
"cmc": 5,
"colors": [
"Blue"
],
"type": "Creature — Elemental",
# Fork this file to make your customizations! For example most people don't have an Ultimate license.
# Add DS Package Store and Boxstarter packages
Set-BoxstarterConfig -NugetSources "http://choco.directs.com/nuget;http://chocolatey.org/api/v2;http://www.myget.org/F/boxstarter/api/v2"
choco sources add -name NuGet -source https://nuget.org/api/v2/
choco sources add -name DS -source http://choco.directs.com/nuget
# Windows Options
Disable-UAC
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
class CircularBuffer < Array
def initialize(size)
@size = size
end
def <<(element)
if self.size < @size || @size.nil?
super
else
self.shift