Skip to content

Instantly share code, notes, and snippets.

View shinypb's full-sized avatar
☀️
I'm just happy to be here.

Mark Christian shinypb

☀️
I'm just happy to be here.
View GitHub Profile
?M
M
.$ D?
:M M
NSDictionary groupItems(NSArray *items) {
int bucket = 0;
NSDictionary *groupedItems = [NSDictionary alloc];
id prevItem;
const kItemTimeDistanceThreshold = 30;
[groupedItems setObject:[NSArray alloc] forKey:bucket];
// I can't remember how to properly iterate in Objective C,
// so let's pretend you can use foreach.
twttr.currentUser.relationshipWith(name, {
success: function(relationship) {
if (canDM) {
that.trigger('dmSuccess', [tweet, that.options.statusAction]);
} else {
error();
}
},
error: error
});
#!/usr/bin/env bash
chmod -x ~/workspace/twitter/.git/hooks/pre-commit
git commit $@
chmod +x ~/workspace/twitter/.git/hooks/pre-commit
Hi, Dan;
Patrick and I were discussing how to resolve today's incident, which stemmed from the fact that anything with a ".js" file extension is served from Apache, not Rails, in production. We've got an end point that returns a dynamic provide statement with a bunch of exported data. Looking at it, it's really just a vessel for that exported data.
How would you feel about extending Loadrunner to automatically export requests to JSON endpoints?
Here's (roughly) what we have now:
In the HTML of the page, we include the data file like this:
using('/account/bootstrap_data.js');
# Where "Foobar" is the name I gave my modem under System Preferences > Network
networksetup -connectpppoeservice Foobar
/* Assume that this component exists somewhere: */
twttr.klass('twttr.components.Person', function(name, location) {
this.name = name;
this.location = location;
});
/* A few ideas for the syntax we should use for asyncronous instantiation: */
// 1. Pass variable number of constructor arguments and callback as the last argument
var callback = function(instance) {
/* Assume that this component exists somewhere: */
twttr.klass('twttr.components.Person', function(name, location) {
this.name = name;
this.location = location;
});
/* A few ideas for asyncronous instantiation: */
// 1. Pass variable number of constructor arguments and callback as the last argument
var callback = function(instance) {
@shinypb
shinypb / gist:873698
Created March 17, 2011 01:34
DoublePane feature request
This is probably a pretty niche feature request, but I'll throw it out here anyway.
For most apps, taking up half the width of the screen is perfect. For a certain class, narrower would be better. The best example of this would be IM contact lists.
So, I humbly suggest that tapping "Move left" when a window has already been pinned to the left edge shrink it from 50% width to 25% width.
Bug: Windows can be moved from secondary monitor onto primary monitor, but not vice versa.
Steps to reproduce.
Begin with a window on your secondary monitor (let's assume that this is the left-most monitor).
1. "Move right" so it's pinned to the right-hand side of the secondary monitor.
2. "Move right" again. It should not be pinned to the left-hand side of the primary monitor.
3. "Move left". Nothing happens.