This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CircularBuffer < Array | |
def initialize(size) | |
@size = size | |
end | |
def <<(element) | |
if self.size < @size || @size.nil? | |
super | |
else | |
self.shift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cards": [ | |
{ | |
"name": "Air Elemental", | |
"manaCost": "{3}{U}{U}", | |
"cmc": 5, | |
"colors": [ | |
"Blue" | |
], | |
"type": "Creature — Elemental", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rakefile | |
require_relative 'sample_application' | |
task :run do | |
SampleApplication.load_legendary_cards | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"card":{ | |
"name":"Narset, Enlightened Master", | |
"manaCost":"{3}{U}{R}{W}", | |
"cmc":6, | |
"colors":[ | |
"White", | |
"Blue", | |
"Red" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets" | |
], | |
"Resource": "arn:aws:s3:::*" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mtgsdk import Set | |
from mtgsdk import Card | |
sets = Set.where(block='Battle for Zendikar|Shadows over Innistrad').all() | |
set_codes = [] | |
for set in sets: | |
set_codes.append(set.code) | |
cards = Card.where(gameFormat='standard') \ | |
.where(set='|'.join(set_codes)) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.1.0", | |
"windows": { | |
"command": "cmd", | |
"args": [ | |
"/C" | |
], | |
"isShellCommand": true | |
}, | |
"linux": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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!" |