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 Rabbitmq | |
include Celluloid | |
ACTOR_NAME = :rabbitmq_publisher | |
RETRY_COUNT = 2 | |
attr_reader :retry_count | |
class << self | |
def publish(message, routing_key, headers = {}, &block) |
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
def commit | |
@transaction_type = 0 | |
Oriented.graph.raw_graph.transaction.current_record_entries.to_a.each do |r| | |
@transaction_type |= TRANSACTION_TYPES[r.type] | |
end | |
@graph.commit | |
Oriented::IdentityMap.clear | |
@retries = 0 | |
rescue Java::ComOrientechnologiesOrientCoreException::OConcurrentModificationException => ex | |
@retries ||= 0 |
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
import Foundation | |
public class Client { | |
public var socket:Socket | |
public var sentdata:dispatch_data_t? | |
// public var channel:dispatch_io_t | |
public var hashValue: Int { return Int(socket.descriptor) } | |
init(socket sock:Socket, sentdata sdata:dispatch_data_t?) { | |
socket = sock |
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
struct Favorite : CustomStringConvertible{ | |
let ID: Int! | |
let name: String! | |
let category: Category! | |
// CustomStringConvertible conformance | |
var description : String { | |
return name | |
} | |
} |
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
Pod::Spec.new do |s| | |
s.name = 'CommonCrypto' | |
s.version = '0.0.1' | |
s.summary = 'Swift module map for CommonCrypto.' | |
s.description = 'Module maps for importing CommonCrypto C libs to Swift.' | |
s.homepage = 'https://github.com/kmussel/commoncrypto' | |
s.license = { :type => 'Public'} | |
s.author = 'Kevin Musselman' | |
s.platform = :ios, '9.0' | |
s.source = { :git => '[email protected]:kmussel/commoncrypto.git', tag: "#{s.version}" } |
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
func captureGroups(withRegex pattern: String, with hosts:String) -> [String] { | |
var matches : [String] = [] | |
var regex: NSRegularExpression | |
do { | |
regex = try NSRegularExpression(pattern: pattern, options: [.caseInsensitive, .anchorsMatchLines]) | |
} catch { | |
return matches | |
} | |
regex.enumerateMatches(in: hosts, options: [], range: NSRange(location: 0, length: hosts.characters.count)) { (result: NSTextCheckingResult?, flags: NSRegularExpression.MatchingFlags, _) in | |
if let range = result?.rangeAt(1) { |
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
sup |
OlderNewer