I hereby claim:
- I am Draveness on github.
- I am draven (https://keybase.io/draven) on keybase.
- I have a public key whose fingerprint is 62CA 63CD FC29 5526 5B5E 9141 30B1 E305 0480 F92E
To claim this, I am signing this object:
# source: https://robots.thoughtbot.com/debugging-why-your-specs-have-slowed-down | |
# spec/spec_helper.rb | |
config.before(:each, :monitor_database_record_creation) do |example| | |
ActiveSupport::Notifications.subscribe("factory_girl.run_factory") do |name, start, finish, id, payload| | |
$stderr.puts "FactoryGirl: #{payload[:strategy]}(:#{payload[:name]})" | |
end | |
end |
def embeds_many_to_has_many(parent, child) | |
child_key_name = child.to_s.underscore.pluralize | |
parent.collection.find({}).each do |parent_document| | |
next unless parent_document[child_key_name] | |
parent_document[child_key_name].each do |child_document| | |
new_child = child_document.merge( | |
"#{parent.to_s.underscore}_id": parent_document['_id'] | |
) | |
child.collection.insert_one new_child | |
end |
I hereby claim:
To claim this, I am signing this object:
// | |
// Token.swift | |
// XProject | |
// | |
// Created by Draveness on 05/04/2017. | |
// Copyright Β© 2017 Draveness. All rights reserved. | |
// | |
import Foundation | |
import RbSwift |
require 'csv' | |
require 'uri' | |
require 'pry' | |
csv_text = File.read('1.csv') | |
csv = CSV.parse(csv_text, :headers => true) | |
hashes = [] | |
csv.each do |row| | |
hash = row.to_hash | |
old = hash["old"] |
#import "ViewController.h" | |
#import <fishhook.h> | |
@interface ViewController () <NSURLSessionDataDelegate> | |
@end | |
@implementation ViewController | |
int (*origianl_connect)(int, const struct sockaddr *, socklen_t); |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |