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
#ifdef NS_BLOCKS_AVAILABLE | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ | |
#endif | |
// background stuff | |
#ifdef NS_BLOCKS_AVAILABLE | |
dispatch_sync(dispatch_get_main_queue(), ^(void) { | |
#endif | |
// main thread stuff |
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
APPLICATION_ID = ENV['PARSE_APPLICATION_ID'] | |
MASTER_KEY = ENV['PARSE_MASTER_KEY'] | |
someDateTime = Time.new | |
ddYear = someDateTime.year | |
ddMonth = "%02d" % someDateTime.month | |
ddDay = "%02d" % someDateTime.day | |
curl_command = "curl --user #{APPLICATION_ID}:#{MASTER_KEY} -X POST -H \"Content-Type: application/json\" -d \'{\"someDate\":{\"__type\": \"Date\", \"iso\": \"#{ddYear}-#{ddMonth}-#{ddDay}T12:00:00.000Z\"},\"someIdentifier\":\"51\"}\' https://api.parse.com/1/classes/MyParseClassObject" |
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
# Class setup. We already have quite a few rows of data in Parse | |
# someDate is a DateTime column | |
# someIdentifier is a String column | |
class MyParseClassObject < ParseResource::Base | |
fields :someDate, :someIdentifier | |
validates_presence_of :someIdentifier | |
end | |
MyParseClassObject.where(:someIdentifier => "51").all |
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
Via @tapbot_paul https://twitter.com/#!/tapbot_paul/status/91681340344381441 | |
codesign -dvvvv --entitlements - Tweetbot.app | |
Original: | |
Ugh freaking provisioning profiles. PSA check your push app with the following. codesign -dvvvv --entitlements - Tweetbot.app |
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
1. stackoverflow-learn-programming-videos/aggr | |
2. global game geography | |
3. table-order | |
4. ? | |
5. control de energia, gastos energéticos | |
6. vieques - finanzas, restauración de crédito (needs legal assistance and web dev) | |
7. miguel - mala experiencia en taxi. incentivos para taxistas dar milla extra (pr lo hace mejor). tweet tip! Twitter Tips. Usar #tags para calcular que taxicabs ganan propinas. | |
8. imagine it - pasajes virtuales. designer, prog, legal | |
9. tareas |
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
// original file: PFRequest.m | |
- (void)buildAndSignPostBody { | |
for (NSString *key in self.command.params) { | |
[self setPostValue:[self.command.params objectForKey:key] forKey:key]; | |
} | |
// This also ensures that posts are not empty, which would break various things | |
[self setPostValue:[NSString stringWithFormat:@"i%@", PARSE_VERSION] forKey:@"v"]; | |
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
<% if current_user.fanpages.include?(fanpage) %> | |
<%= link_to image_tag("trackstar-selected-icon.png", :width => "24", :height => "24")%> | |
<% else %> | |
<%= link_to image_tag("trackstar-unselected-icon.png", :width => "24", :height => "24")%> | |
<% 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
<% form_for fanpage do |form| %> | |
<%= image_submit_tag("trackstar-selected-icon.png") %> | |
<% 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
def parse_superfeedr_checkin | |
json_response = Hash.new # parse from superfeedr | |
checkin_url = "" #get from superfeedr | |
user_id = "" # get from superfeedr | |
user = User.find(user_id) # else could get username from superfeedr and fetch by_nickname | |
if user | |
checkin = user.checkins.find_by_url(checkin_url) || user.checkins.create_with_superfeedr_response(json_response) | |
end | |
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
def self.create_with_superfeedr_response(json_response) | |
create! do |checkin| | |
checkin.activity_url = json_response["activity_url"] | |
checkin.user_id = json_response["user_id"] | |
if json_response["object"] | |
spot_hash = Hash.new | |
#spot_hash["image_url"] = ? | |
spot_hash["lat"] = json_response["geo"]["coordinates"][0] | |
spot_hash["lng"] = json_response["geo"]["coordinates"][1] | |
spot_hash["name"] = json_response["object"]["title"] |