Skip to content

Instantly share code, notes, and snippets.

View elsurudo's full-sized avatar

Ernest Surudo elsurudo

View GitHub Profile
@elsurudo
elsurudo / ActivityIndicatorModal.tsx
Created June 14, 2021 08:16
Activity indicator modal for react-native-navigation
import React from 'react';
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
import { Navigation } from 'react-native-navigation';
import Theme from '../../Theme';
export interface Props {
message: string;
}
@elsurudo
elsurudo / obfuscation.rb
Created March 25, 2019 13:59
Knuthy Obfuscation (Optimus Prime)
# 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 July 18, 2016 08:59
Class to handle Server Sent Events in a similar way to browser EventSource
#import <Foundation/Foundation.h>
@class EventSource;
@protocol EventSourceDelegate <NSObject>
@optional
- (void)eventSourceDidOpenConnection:(EventSource*)eventSource;
- (void)eventSource:(EventSource*)eventSource didFailWithError:(NSError*)error;