Skip to content

Instantly share code, notes, and snippets.

View ReDetection's full-sized avatar
🛰️
Converting ideas into fun

Serg ReDetection

🛰️
Converting ideas into fun
View GitHub Profile
@ReDetection
ReDetection / gist:e2cbbaf730493b788909
Created September 25, 2014 11:00 — forked from gdavis/gist:2845766
fixed conversion warning
#pragma mark - Phone Number Field Formatting
// Adopted from: http://stackoverflow.com/questions/6052966/phone-number-formatting
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (textField == self.mobileNumberField || textField == self.homeNumberField || textField == self.workNumberField) {
int length = [self getLength:textField.text];
if(length == 10) {
if(range.length == 0)
@ReDetection
ReDetection / filterHotelsByRatePlan.js
Created November 11, 2015 16:34
filterHotelsByRatePlan.js
import R from 'ramda';
// [] -> Boolean
function notEmpty(xs) {
return xs.length > 0;
}
// (RatePlan -> Boolean) -> [AvailableHotel] -> [AvailableHotel]
function filterHotelsByRatePlan(ratePlanIndicator) {
const ratePlans = R.filter(ratePlanIndicator);