I hereby claim:
- I am djmckee on github.
- I am djmckee (https://keybase.io/djmckee) on keybase.
- I have a public key whose fingerprint is E1EB 9E97 2289 6D6B E5A6 8355 8FF2 24E2 8960 F026
To claim this, I am signing this object:
Verifying that +dylanm is my blockchain ID. https://onename.com/dylanm |
int[] array = {1, 2, 2, 2, 3}; | |
// The number you're counting occurrences of... | |
int number = 2; | |
// The number of times it occurs | |
int count = 0; | |
for (int i: array) { | |
if (i == number) { |
int[] array = {10, 20}; | |
int total = 0; | |
for (int i : array) { | |
total = total + i; | |
} | |
double average = (double)(total/array.length); | |
System.out.println("The average is: " + average + " :~)"); |
// | |
// GrouponApi.swift | |
// Munchies | |
// | |
// Created by Dylan McKee on 13/07/2015. | |
// Copyright (c) 2015 djmckee. All rights reserved. | |
// | |
import Foundation | |
import CoreLocation |
$("label").each(function (index) { | |
// get the 'for' value... | |
var forValue = $(this).attr('for'); | |
// get the inner text... | |
var labelContent = $(this).text(); | |
// remove trailing ':' from inner text... | |
if (labelContent.charAt(labelContent.length - 1) == ':') { | |
labelContent = labelContent.substring(0, labelContent.length - 1); |
# Requires https://pypi.python.org/pypi/topia.termextract/ | |
from topia.termextract import extract | |
def generate_keyword_tags(string): | |
# instantiate our termextract instance | |
extractor = extract.TermExtractor() | |
# for keyword tags, we only care about the first 20 it picks out... | |
tags = extractor.tagger(string)[:20] |
import Foundation | |
extension NSDate { | |
func jsonDate() -> String { | |
let dateFormatter = NSDateFormatter() | |
// JSON Date fromat from http://gistpages.com/2015/05/21/convert_nsdate_to_json_date_format | |
dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'SSS'Z'" | |
return String(dateFormatter.stringFromDate(self)) |
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
import UIKit | |
extension UIColor { | |
// A factory method to take an rgb colour string ("rgb(255,255,255)") and return a UIColor object. | |
class func colorFromRGBString(string: String) -> UIColor { | |
// create mutable copy... | |
var rgbString = string |
import Foundation | |
extension String { | |
// check if the string contains otherString, return accordingly. | |
func contains(otherString:String!) -> Bool { | |
if self.rangeOfString(otherString) != nil{ | |
return true | |
} else { | |
return false |