Skip to content

Instantly share code, notes, and snippets.

Avatar

Ernest Surudo elsurudo

View GitHub Profile
@elsurudo
elsurudo / obfuscation.rb
Created Mar 25, 2019
Knuthy Obfuscation (Optimus Prime)
View obfuscation.rb
# app/models/concerns/obfuscation.rb
# ID obfuscation using Optimus algorithm
# TODO if we want to use this with more classes, it'd
# be best to make sure we use a different random seed
# for each model.
# Do something like this: http://jes.al/2014/11/creating-rails-concern-accepts-argumentsparameters/
module Obfuscation
extend ActiveSupport::Concern
@elsurudo
elsurudo / EventSource.h
Last active Jul 18, 2016
Class to handle Server Sent Events in a similar way to browser EventSource
View EventSource.h
#import <Foundation/Foundation.h>
@class EventSource;
@protocol EventSourceDelegate <NSObject>
@optional
- (void)eventSourceDidOpenConnection:(EventSource*)eventSource;
- (void)eventSource:(EventSource*)eventSource didFailWithError:(NSError*)error;
You can’t perform that action at this time.