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
XML -> NSDictionary | |
NSError *error = nil; | |
NSString *contents = [NSString stringWithContentsOfURL:[NSURL URLWithString:searchIncentivesURL] | |
encoding:NSUTF8StringEncoding | |
error:&error]; | |
NSData* xmlData = [contents dataUsingEncoding:NSUTF8StringEncoding]; | |
NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLData:xmlData error:error]; |
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
default[:vertx][:version] = '2.0.2' | |
default[:vertx][:home] = '/srv/vertx' | |
default[:vertx][:url] = 'http://dl.bintray.com/vertx/downloads/' | |
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
public class SharedData | |
extends java.lang.Object | |
Sometimes it is desirable to share immutable data between different event loops, for example to implement a cache of data. | |
This class allows instances of shared data structures to be looked up and used from different event loops. | |
The data structures themselves will only allow certain data types to be stored into them. This shields you from worrying about any thread safety issues might occur if mutable objects were shared between event loops. | |
The following types can be stored in a shareddata data structure: | |
String |
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
{ | |
"servers" : [ { | |
"alias" : "<%= @node[:hostname] %>", | |
"host" : "<%= @node[:hostname] %>", | |
"port" : "<%= @jmx_port %>", | |
"username" : "<%= @jmx_user %>", | |
"password" : "<%= @jmx_password %>", | |
"queries" : [ | |
{ | |
"obj" : "java.lang:type=Memory", |
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
include_recipe "graphite" | |
begin | |
r = resources(:template => "#{node['graphite']['base_dir']}/conf/storage-schemas.conf") | |
r.cookbook "my-cookbook" | |
rescue Chef::Exceptions::ResourceNotFound | |
Chef::Log.warn "could not find template to override!" | |
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
require 'net/http' | |
link = URI.parse('http://169.254.169.254/latest/meta-data/instance-id') | |
request = Net::HTTP::Get.new(link.path) | |
begin | |
response = Net::HTTP.start(link.host, link.port) { |http| | |
http.read_timeout = 5 #Default is 60 seconds | |
http.request(request) | |
} |
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 'net/http' | |
link = URI.parse('http://169.254.169.254/latest/meta-data/instance-id') | |
request = Net::HTTP::Get.new(link.path) | |
begin | |
response = Net::HTTP.start(link.host, link.port) { |http| | |
http.read_timeout = 5 #Default is 60 seconds | |
http.request(request) | |
} |
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
0 require 'net/http'¬ | |
1 ·¬ | |
2 uri = URI.parse('http://169.254.169.254/latest/meta-data/instance-id')¬ | |
3 ·¬ | |
4 begin¬ | |
5 Net::HTTP.start(uri.host, uri.port) do |http|¬ | |
6 request = Net::HTTP::Get.new uri.request_uri¬ | |
7 http.open_timeout = 5¬ | |
8 respone = http.request request·¬ | |
9 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
require 'net/http' | |
uri = URI.parse('http://169.254.169.254/latest/meta-data/instance-id') | |
begin | |
Net::HTTP.start(uri.host, uri.port) do |http| | |
request = Net::HTTP::Get.new uri.request_uri | |
http.open_timeout = 5 | |
respone = http.request request | |
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
IT'S SHOWTIME | |
HEY CHRISTMAS TREE bottles | |
YOU SET US UP 99 | |
HEY CHRISTMAS TREE loop | |
YOU SET US UP @NO PROBLEMO | |
HEY CHRISTMAS TREE result | |
YOU SET US UP @I LIED |
OlderNewer