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 |
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
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
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
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
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
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
require_relative 'rabbitmq.rb' | |
class Rpc | |
attr_reader :connection | |
attr_reader :lock, :condition | |
attr_accessor :response, :call_id | |
DEFAULT_RETRY_TIMEOUT = 60 | |
def initialize(opts = {}) |
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 static Object createLink(final ODocument iFromVertex, | |
final OIdentifiable iTo, final String iFieldName) { | |
final Object out; | |
Object found = iFromVertex.field(iFieldName); | |
if (found == null) | |
// CREATE ONLY ONE LINK | |
out = iTo; | |
else if (found instanceof OIdentifiable) { | |
if (found.equals(iTo)) | |
// SAME LINK, SKIP IT |
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
(develop)$ jruby -S trinidad | |
Deploying from /kyck_registrar_web as / | |
Initializing ProtocolHandler ["http-bio-0.0.0.0-4244"] | |
jruby 1.7.4 (1.9.3p392) 2013-05-28 fffffff on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b12 [darwin-x86_64] | |
using 1:5 runtime pool with acquire timeout of 5.0 seconds | |
Config HA cluster, ha.server_id: 2, db: /db/ha_neo_server_2 | |
Connecting to database specified by database.yml | |
/config/initializers/devise.rb:247 warning: already initialized constant VERIFY_PEER | |
added application to pool, size now = 1 | |
Starting ProtocolHandler ["http-bio-0.0.0.0-4244"] |
NewerOlder