Skip to content

Instantly share code, notes, and snippets.

View popthestack's full-sized avatar
🍩
Eating Donuts

Ryan Martinsen popthestack

🍩
Eating Donuts
View GitHub Profile
@popthestack
popthestack / am-pm-other-locales.markdown
Last active December 18, 2015 18:28
Anyone have any idea what these prefixes mean? Are they AM or PM?

Unknown

11:21:45 em
10:16:03 e.m.

12:44:04 e.h.

10:29:20 f.m.
08:36:43 fm

@popthestack
popthestack / gist:5877965
Last active December 19, 2015 01:39
RFC 3339 date string in Objective C
NSDate *now = [[NSDate alloc] init];
NSTimeZone *localTimeZone = [NSTimeZone systemTimeZone];
NSDateFormatter *rfc3339DateFormatter = [[NSDateFormatter alloc] init];
NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
[rfc3339DateFormatter setLocale:enUSPOSIXLocale];
[rfc3339DateFormatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ssZ"];
[rfc3339DateFormatter setTimeZone:localTimeZone];
NSString *dateString = [rfc3339DateFormatter stringFromDate:now];
Originally found here: http://newyork.craigslist.org/brk/mis/3985247459.html
I saw you on the Manhattan-bound Brooklyn Q train.
I was wearing a blue-striped t-shirt and a pair of maroon pants. You were
wearing a vintage red skirt and a smart white blouse. We both wore glasses. I
guess we still do.
You got on at DeKalb and sat across from me and we made eye contact, briefly. I
fell in love with you a little bit, in that stupid way where you completely make

Keybase proof

I hereby claim:

  • I am popthestack on github.
  • I am popthestack (https://keybase.io/popthestack) on keybase.
  • I have a public key whose fingerprint is 94AD BD13 B133 D1B1 9F25 238B 114E 783D 48EC 7F47

To claim this, I am signing this object:

require 'rubygems'
require 'yaml'
require 'net/http'
require 'uri'
#
# Check that the HTTP Response is as expected.
# See -help for format of the input file
#
class CheckHttpResponse
@popthestack
popthestack / fiveminutejournal.md
Last active December 26, 2021 18:26
Five minute journal template for use with the Day One app. I use it with a TextExpander shortcut ";fiveminutejournal". Inspired by http://mattmazur.com/2015/12/16/the-joy-of-the-five-minute-journal/

Five Minute Journal Entry

3 things I am grateful for…

3 things that would make today great…

@popthestack
popthestack / promises-and-this.js
Created March 30, 2016 14:02
Passing methods that use `this` into promises or promisifying them with bluebird can lead to confusing results. This isn't specific to promises, but rather how the prototype works.
var Promise = require('bluebird');
function Blah() {
this.foo = 'blah';
}
Blah.prototype.tester = function() {
console.log(this.foo);
};