This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'CSV' | |
require 'plist' | |
file = File.open('somecsv.csv') | |
list = CSV.parse(file.read) | |
1.upto(list.count) do |row| | |
if(!list[row].nil?) | |
hash[list[row][0]] = list[row][1] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface GOCustomView : UIView | |
@property(nonatomic, retain) UIColor *bgColor; | |
@property (nonatomic,retain) NSMutableArray *xArr; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSMutableArray*)xArr{ | |
if(_xArr){ | |
return _xArry; | |
} | |
_xArr = [[NSMutableArray alloc] init]; | |
return _xArr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGFloat maxX = 0.0f; | |
CGFloat maxY = 0.0f; | |
[self.points enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop){ | |
CGPoint point = [obj CGPointValue]; | |
if(point.x > maxX){ | |
maxX = point.x; | |
} | |
if(point.y > maxY){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUInteger i = 0; | |
NSValue *value = [self.points objectAtIndex:i]; | |
CGPoint point = [value CGPointValue]; | |
// Do stuff with your point. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Don't allow commits that aren't mentioning a ticket. | |
# | |
test "" != "$(grep '#[0-9]\+' "$1")" || { | |
echo >&2 You must mention a ticket when commiting! | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'date' | |
puts "hi, I'm gonna do math!" | |
class CalendarItem | |
attr_accessor :date | |
attr_accessor :amount | |
def initialize(date, amount) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
async = require('async'); | |
fs.readFile('work.txt', 'utf8', function(err, data){ | |
if(err){ | |
throw err; | |
} | |
var lines = data.split('\n'); | |
var iterator = function(item, callback){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
☁ Tribo [editable_templates] git submodule init | |
Submodule 'Dependencies/CocoaHTTPServer' () registered for path 'Dependencies/CocoaHTTPServer' | |
Submodule 'Dependencies/GRMustache' () registered for path 'Dependencies/GRMustache' | |
Submodule 'Dependencies/Sundown' () registered for path 'Dependencies/Sundown' | |
☁ Tribo [editable_templates] git submodule update | |
fatal: Not a git repository: /Users/sgoodwin/Desktop/Side Projects/Blogging/Tribo/.git/modules/Dependencies/CocoaHTTPServer | |
Unable to find current revision in submodule path 'Dependencies/CocoaHTTPServer' | |
☁ Tribo [editable_templates] git status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GOViewController.h | |
// Example | |
// | |
// Created by Samuel Goodwin on 4/10/12. | |
// Copyright (c) Your Momma. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
OlderNewer