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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* DeviceUID.h | |
#import <Foundation/Foundation.h> | |
@interface DeviceUID : NSObject | |
+ (NSString *)uid; | |
@end | |
*/ | |
// Device.m |
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
A Mongoid::Criteria instance should not respond_to :reject! or any other in place changing iterators | |
it should also be forced to run after calling #inspect mimicking an ActiveRecord::Relation |
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
systemLog: | |
destination: file | |
path: '/usr/local/var/log/mongodb/mongod1.log' | |
logAppend: true | |
storage: | |
dbPath: '/usr/local/var/mongodb1' | |
directoryPerDB: true | |
journal: | |
enabled: true | |
engine: wiredTiger |
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
r.pipelined do | |
keys.each do |k| | |
r.multi do | |
values << r.get(k) | |
r.del(k) | |
end | |
end | |
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
+ (BOOL)isDebugMode | |
{ | |
if ([HKDevice isSimulator]) return YES; | |
static BOOL isDebugMode = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// There is no provisioning profile in AppStore Apps. | |
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
if (data) { |
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
* * * * * /bin/ps aux | grep [q]ueue_manager:start || (cd /var/www/lqd.io/current ; RAILS_ENV=staging /home/deployer/.rvm/gems/ruby-2.1.1@global/bin/bundle exec rake queue_manager:start &) |
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
2014-07-10T11:55:23.225+0000 [slaveTracking] processing update : query: { _id: ObjectId('53445ccb8e0ae053848b25c6'), config: { _id: 1, host: "10.0.0.11:27017", priority: 0.4 }, ns: "local.oplog.rs" } updated: { $set: { syncedTo: Timestamp 1404993323000|4 } } god: 0 upsert: 1 multi: 0 callLogOp: 1 fromMigration: 0 fromReplications: 0 | |
2014-07-10T11:55:23.225+0000 [slaveTracking] Relevant index 0 is kp: { _id: 1 } io: { v: 1, name: "_id_", key: { _id: 1 }, ns: "local.slaves" } | |
2014-07-10T11:55:23.225+0000 [slaveTracking] Only one plan is available; it will be run but will not be cached. query: { _id: ObjectId('53445ccb8e0ae053848b25c6'), config: { _id: 1, host: "10.0.0.11:27017", priority: 0.4 }, ns: "local.oplog.rs" } sort: {} projection: {}, planSummary: IXSCAN { _id: 1 } | |
2014-07-10T11:55:23.225+0000 [slaveTracking] update validate options -- updatedFields: Fields:[ ] immutableAndSingleValueFields.size:0 fromRepl: 0 validate:1 | |
2014-07-10T11:55:23.225+0000 [slaveTracking] update validate options -- updatedFi |
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
kill $(ps aux | grep [m]ongod | awk '{ print $2 }') |
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
<?php | |
if (in_array($name, array_keys($this->calls))) { | |
if ($this->$name($data)) { | |
return $this->dialIn($name, $data); | |
} | |
} else { | |
return "Non-existent call"; | |
} |