Skip to content

Instantly share code, notes, and snippets.

Avatar
🛰️
Converting ideas into fun

Serg ReDetection

🛰️
Converting ideas into fun
View GitHub Profile
View 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);
@ReDetection
ReDetection / gist:e2cbbaf730493b788909
Created Sep 25, 2014 — forked from gdavis/gist:2845766
fixed conversion warning
View gist:e2cbbaf730493b788909
#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)