Skip to content

Instantly share code, notes, and snippets.

@randydillon
randydillon / extensions_naming.swift
Created December 23, 2018 17:04
Swift Extension Naming Example
import UIKit
class SwiftTableViewController: UITableViewController {
init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
}
override func viewDidLoad() {
super.viewDidLoad()
}
}
@randydillon
randydillon / index.html
Created February 20, 2016 01:07
jQuery Tutorial #1 - jQuery Tutorial for Beginners Final Source
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content="Bluefish 2.2.6" >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link rel="stylesheet" href=
@randydillon
randydillon / stripeios9example.m
Created December 21, 2015 22:10
Objective-C Stripe iOS9 using
- (IBAction)buyButtonTapped:(id)sender{
param = [[STPCardParams alloc]init];
param.number = txt_cc_no.text;
param.cvc = txt_cc_cvvno.text;
param.expMonth =[self.selectedMonth integerValue];
param.expYear = [self.selectedYear integerValue];
if ([self validateCustomerInfo]) {
- (void)bannerTapped:(UIGestureRecognizer *)gestureRecognizer;
// ------------
touchableImage.image = [UIImage imageNamed:@"touchableImage.png"];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(bannerTapped:)];
singleTap.numberOfTapsRequired = 1;
singleTap.numberOfTouchesRequired = 1;
[touchableImage addGestureRecognizer:singleTap];
@randydillon
randydillon / gist:e8eda71a45ae96970015
Created March 5, 2015 23:20
Remove Attributes from NSMutableAttributedString
NSMutableAttributedString *originalMutableAttributedString = //your string
NSRange originalRange = NSMakeRange(0, originalMutableAttributedString.length);
[originalMutableAttributedString setAttributes:@{} range:originalRange];
@randydillon
randydillon / gist:169e44dcba5e717ab49b
Created March 5, 2015 23:14
remove all of the attributes from NSMutableAttributedString conditionally
[originalMutableAttributedString enumerateAttributesInRange:originalRange
options:kNilOptions
usingBlock:^(NSDictionary *attrs, NSRange range, BOOL *stop) {
[attrs enumerateKeysAndObjectsUsingBlock:^(NSString *attribute, id obj, BOOL *stop) {
[originalMutableAttributedString removeAttribute:attribute range:range];
}];
}];