Skip to content

Instantly share code, notes, and snippets.

View andrei4002's full-sized avatar

Andrei Stoicescu andrei4002

  • Bucharest, Romania
View GitHub Profile
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize {
_node1.style.preferredSize = CGSizeMake(constrainedSize.max.width, 200);
_node2.style.preferredSize = CGSizeMake(constrainedSize.max.width, 40);
_node3.style.height = _currentState == StateTypeSmall ? ASDimensionMakeWithPoints(300) : ASDimensionMakeWithPoints(450);
ASDisplayNode *spacer = [][ASDisplayNode alloc] init];
spacer.style.flexGrow = 1.0;
return [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
@andrei4002
andrei4002 / cell.m
Created January 29, 2017 13:55
ASDK - some errors - how to fix?
- (ASLayoutSpec *) layoutSpecThatFits:(ASSizeRange)constrainedSize {
CGFloat ratio = 9.0/16.0;
self.iconImageNode.style.preferredSize = CGSizeMake(16, 16);
self.userAvatarImageNode.style.preferredSize = CGSizeMake(48, 48);
self.userNameNode.style.flexShrink = 1;
ASStackLayoutSpec *displayUnitPayloadStack =
[ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical
spacing:4
@andrei4002
andrei4002 / bf.ro
Last active December 29, 2015 01:09 — forked from clyfe/bf.ro
#on windows
#careful, it will wake up the dead too
require 'open-uri'
require 'win32/sound'
include Win32
loop do
available = true
begin