This a collection of interesting links found in The Imposter's Handbook by Rob Conery.
Content:
This file contains hidden or 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 'fog' | |
| require 'chef/config' | |
| Chef::Config.from_file('./.chef/knife.rb') | |
| EC2 = Fog::Compute.new provider: 'AWS', | |
| region: Chef::Config[:knife][:region], | |
| aws_access_key_id: Chef::Config[:knife][:aws_access_key_id], | |
| aws_secret_access_key: Chef::Config[:knife][:aws_secret_access_key] | |
| servers = EC2.servers.select { |s| s.tags["Name"] =~ /ec2\-test\-/ && s.state == "running" } |
This file contains hidden or 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
| /* | |
| Contains the file manager implementation of ServiceStack's REST /files Web Service: | |
| Demo: http://www.servicestack.net/RestFiles/ | |
| GitHub: https://github.com/ServiceStack/ServiceStack.Examples/ | |
| */ | |
| using System; | |
| using System.IO; | |
| using System.Net; | |
| using RestFiles.ServiceInterface.Support; |
This file contains hidden or 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
| /// <summary> | |
| /// Provides projection mapping from an IQueryable sourceto a target type. | |
| /// | |
| /// This allows from strongly-typed mapping and querying only necessary fields from the database. | |
| /// It takes the place of Domain -> ViewModel mapping as it allows the ViewModel to stay as | |
| /// IQueryable. AutoMapper works on in-memory objects and will pull all full records to perform | |
| /// a collection mapping. Use AutoMapper for Input -> Domain scenarios, but not DAL. | |
| /// | |
| /// Reference: http://devtrends.co.uk/blog/stop-using-automapper-in-your-data-access-code | |
| /// </summary> |
This file contains hidden or 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
| AZHU.storage = { | |
| save : function(key, jsonData, expirationMin){ | |
| if (!Modernizr.localstorage){return false;} | |
| var expirationMS = expirationMin * 60 * 1000; | |
| var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS} | |
| localStorage.setItem(key, JSON.stringify(record)); | |
| return jsonData; | |
| }, | |
| load : function(key){ | |
| if (!Modernizr.localstorage){return false;} |