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
#config/initializers/redis.rb | |
require 'redis' | |
require 'redis/objects' | |
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys | |
dflt = REDIS_CONFIG[:default].symbolize_keys | |
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym] | |
$redis = Redis.new(cnfg) | |
Redis::Objects.redis = $redis |
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
// code originally adapted from https://github.com/DuncanMC/SwiftPerformanceBenchmark | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <CoreFoundation/CFDate.h> | |
void updateTotal(int newTotal, CFAbsoluteTime startTime) { | |
CFAbsoluteTime now = CFAbsoluteTimeGetCurrent(); | |
CFAbsoluteTime totalTime = now - startTime; |
NewerOlder