Skip to content

Instantly share code, notes, and snippets.

Avatar

Travis Delly Dellybro

View GitHub Profile
View User.rb
class User < ActiveRecord::Base
# Validation methods
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, length: { maximum: 255 },
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
validates :password, confirmation: true, length: { minimum: 6},
unless: Proc.new { |user| user.password.blank? }
View authorization.js
var models = require('../../models')
var Log = require('../../tools/Log')
var jwt = require('jsonwebtoken')
var config = require('../../config')
var Sequelize = require('sequelize');
var authChecker = function(req, res, next){
if(req.cookies['retco']) {
jwt.verify(req.cookies['retco'], config.PUBLICKEY, {algorithms: ['RS256']}, (err, decoded) => {
if (err) {
View CustomScripts.js
module.exports = {
intersection: function(array1, array2) {
var returnedArray = [];
for (var i = 0; i < array1.length; i++) {
if(array2.includes(array1[i])){
returnedArray.push(array1[i]);
}
}
return returnedArray;
},
View TutorialScreenController.h
#import <UIKit/UIKit.h>
#import "TutorialScreenController.h"
@interface TutorialPopoverScreen : UIViewController
@property (assign, nonatomic) NSInteger index;
@property (strong, nonatomic) IBOutlet UILabel *screenNumber;
View CustomViews.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define ESTIMATEDPHONEHEIGHT ([[UIScreen mainScreen] bounds].size.height)/667
#define ESTIMATEDPHONEWIDTH ([[UIScreen mainScreen] bounds].size.width)/375
@Dellybro
Dellybro / CustomScripts.h
Created Nov 22, 2016
CustomScript Files
View CustomScripts.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface CustomScripts : NSObject
+ (UIImage *)scaleImage:(UIImage *)image scaledToSize:(CGSize)newSize;
+ (void)addShadowToView:(UIView*)view options:(NSDictionary*)options;
+ (UIColor *)colorWithHexString:(NSString *)stringToConvert;
@end
View keybase.md

Keybase proof

I hereby claim:

  • I am dellybro on github.
  • I am dellybro (https://keybase.io/dellybro) on keybase.
  • I have a public key whose fingerprint is D4DB 8917 DFBC 7E21 625C CD86 0215 612A F5B0 F453

To claim this, I am signing this object:

You can’t perform that action at this time.