Skip to content

Instantly share code, notes, and snippets.

--- Part Two ---
Now that the machine is calibrated, you're ready to begin molecule fabrication.
Molecule fabrication always begins with just a single electron, e, and applying
replacements one at a time, just like the ones during calibration.
For example, suppose you have the following replacements:
e => H
# ruby 2.1.6
irb(main):006:0> 0.30 * 100
=> 30.0
irb(main):007:0> 0.29 * 100
=> 28.999999999999996
irb(main):008:0> 0.28 * 100
=> 28.000000000000004
irb(main):009:0> 0.27 * 100
=> 27.0
peripheral:didDiscoverServices:
<CBService: 0x134db3950, isPrimary = YES, UUID = Device Information>
peripheral:didDiscoverDescriptorsForCharacteristic:
<CBCharacteristic: 0x134f1a020, UUID = Manufacturer Name String, properties = 0x2, value = (null), notifying = NO>
def to_live?
if !@to_live
@to_live = true
return true
end
!@to_live
end

Keybase proof

I hereby claim:

  • I am veader on github.
  • I am veader (https://keybase.io/veader) on keybase.
  • I have a public key whose fingerprint is E783 7F47 0571 3887 A5DB D941 1306 604F 8071 14B4

To claim this, I am signing this object:

- (void)testShouldDecodeBase64EncodedString {
NSString *encodedString = @"ZEdWemRBPT0=";
NSString *decodedString = [[NSString stringWithBase64EncodedString:encodedString] base64DecodedString];
NSString *properResult = @"test";
XCTAssert([properResult isEqualToString:decodedString], @"Unable to decode base64 encoded string");
}
- (void)testShouldWorkWithoutCategoryToDecodeUTF8String {
NSString *encodedString = @"dTA0QTA6INKgINKhINKiINKjINKkINKlINKmINKnINKoINKpINKqINKrINKsINKtINKuINKvINKwINKxINKyINKzINK0INK1INK2INK3INK4INK5INK6INK7INK8INK9INK+INK/";
NSData *encodedData = [[NSData alloc] initWithBase64Encoding:encodedString];
@veader
veader / gist:6539106
Created September 12, 2013 15:10
Ember Routing Fun
// these are the routes I'd like to define
//
// /posts (load all posts)
// /posts/all (only here for completeness)
// /posts/archived (load only archived posts)
// /posts/unpublished (load only unpublished posts)
// /posts/1 (load individual post)
// the only way I can see doing it in Ember at this point (1.0)
App.Router.map({
vagrant@precise64:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:88:0c:a6
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe88:ca6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9696 errors:0 dropped:0 overruns:0 frame:0
TX packets:9562 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:943407 (943.4 KB) TX bytes:808267 (808.2 KB)
# monkey patch resolver to properly decode URI encoded attributes
class ActiveRecord::Base::ConnectionSpecification
class Resolver
private
def connection_url_to_hash(url)
config = URI.parse url
adapter = config.scheme
adapter = "postgresql" if adapter == "postgres"
spec = { :adapter => adapter,
:username => config.user,

Working States

Fresh Launch (no saved auth) -> Auth View

Fresh Launch (saved auth) -> Nav/Popular Photos View

.... Nav/Popular Photos View -> Logout -> Auth View

Not Working State