This file contains hidden or 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
| (ns honeycomb.core | |
| (:gen-class) | |
| (:require [clojure.string :as string] | |
| [clojure.java.io :as io])) | |
| ;; this is basically an iterative approach, which avoids building up lazy sequences. there | |
| ;; would be almost no overhead here in terms of memory or objects | |
| (defn -main-simple | |
| "Prints n random rows from given filenames. All command-line arguments are strings." |
This file contains hidden or 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
| // snip some code that compiles with no errors | |
| // the whole file compiles if I remove the category implementation below: | |
| @implementation NSString (colors) | |
| - (UIColor *)colorValue | |
| { | |
| // snip some other code | |
| } |
This file contains hidden or 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 height = self.view.bounds.size.height - self.toolbar.bounds.size.height; | |
| self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, height)]; | |
| self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin; |
This file contains hidden or 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
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| UISearchBar *bar = self.searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 20)]; | |
| [bar sizeToFit]; | |
| bar.autoresizingMask = UIViewAutoresizingFlexibleWidth; | |
| bar.tintColor = [UIColor colorWithWhite:(121.0/255.0) alpha:1.0]; | |
| [self.view addSubview:bar]; | |
This file contains hidden or 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 TableViewRow = Backbone.View.extend({ | |
| tagName: "tr", | |
| template: _.template("<td><%= firstName %></td><td><%= lastName %></td>"), | |
| render: function() { | |
| this.$el.html(this.template(this.model.toJSON())); | |
| return this; | |
| } | |
| }); |
This file contains hidden or 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
| NSCalendar *cal = [NSCalendar autoupdatingCurrentCalendar]; | |
| self.postsByDate = [self.posts arrayByPartitioningWithBlock:^(RSSFeedItem *obj) { | |
| NSDate *day; | |
| NSTimeInterval tip; | |
| [cal rangeOfUnit:NSDayCalendarUnit startDate:&day interval:&tip forDate:obj.pubDate]; | |
| return day; | |
| }]; |
This file contains hidden or 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/ruby | |
| # Generate a password table with a given seed ("master" password... sort of) | |
| s=ARGV[0] and srand(s.hash) | |
| x_axis = %w(a b c d e f g h i j k l m n o p q r s t u v) | |
| y_axis = %w(ab cd ef gh ij kl mn op qr st uv) | |
| pw_chars = x_axis + %w(0 1 2 3 4 5 6 7 8 9 ! @ $ % ^ &) |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Dynamic Stacked Bar Chart using d3.js</title> | |
| <script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
| <style> | |
| rect.a { | |
| fill: green; | |
| } | |
| rect.b { | |
| fill: orange; |
This file contains hidden or 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
| (function($) { | |
| // an extension to jQuery to allow "find" with XML namespaces | |
| $.fn.findNS = function(ns, selector) { | |
| var prefix = ns + ":"; | |
| return this.find(selector).filter(function(idx, el) { | |
| return el.nodeName.indexOf(prefix) == 0; | |
| }); | |
| } | |
| })(jQuery); |
This file contains hidden or 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
| (function ($) { | |
| //demo data | |
| var contacts = [ | |
| { name: "Contact 1", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "family" }, | |
| { name: "Contact 2", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "family" }, | |
| { name: "Contact 3", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "friend" }, | |
| { name: "Contact 4", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "colleague" }, | |
| { name: "Contact 5", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "family" }, | |
| { name: "Contact 6", address: "1, a street, a town, a city, AB12 3CD", tel: "0123456789", email: "[email protected]", type: "colleague" }, |