Skip to content

Instantly share code, notes, and snippets.

View cysp's full-sized avatar
📲
📴

Scott Talbot cysp

📲
📴
View GitHub Profile
@cysp
cysp / .gitignore
Last active October 25, 2022 12:16
Apollo Gateway v2 Query Validation Testcase
/node_modules
/package-lock.json
import JavaScriptCore
extension JSValueDecoder {
struct JSValueKeyedDecodingContainer<Key>: KeyedDecodingContainerProtocol where Key: CodingKey {
init(value: JSValue, codingPath: [CodingKey] = []) {
self.value = value
self.codingPath = codingPath
}
let value: JSValue
@cysp
cysp / FeatureFlags.swift
Created December 10, 2019 07:05
Feature Flags
import Swift
enum Output {
enum Node {
case value(Bool)
case object([String: Node])
}
}
extension Output.Node {
@cysp
cysp / keybase.md
Created December 5, 2017 22:16
keybase.md

Keybase proof

I hereby claim:

  • I am cysp on github.
  • I am cysp (https://keybase.io/cysp) on keybase.
  • I have a public key ASBVs-uUKcSPicS3b4P6F1CAdp-AnmwVtODqemIWFq8PIQo

To claim this, I am signing this object:

@cysp
cysp / foo.m
Last active August 29, 2015 14:18
ObjC dot-notation setter chaining‽
#import <Foundation/Foundation.h>
@interface Foo : NSObject
@property (nonatomic,copy,readonly) NSArray *foo;
@end
@implementation Foo
- (NSArray *)setFoo:(NSArray *)foo {
return _foo = @[ @"bar", ];
}
@end
restify = require 'restify'
unirest = require 'unirest'
util = require 'util'
server = restify.createServer serverOptions
server.get {
path: '/test'
name: 'test'
@implementation XXNavigationBar
- (id)initWithFrame:(CGRect)frame {
//…
Class const UIImageViewClass = [UIImageView class];
for (UIView *subview in self.subviews) {
for (UIView *subsubview in subview.subviews) {
if ([subsubview isKindOfClass:UIImageViewClass] && CGRectGetHeight(subsubview.frame) <= 1) {
[subsubview removeFromSuperview];
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 8df9c3b..adea0db 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1222,7 +1222,9 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
ElemDie = createAndAddDIE(Property.getTag(), Buffer);
StringRef PropertyName = Property.getObjCPropertyName();
addString(ElemDie, dwarf::DW_AT_APPLE_property_name, PropertyName);
- addType(ElemDie, Property.getType());
+ if (Property.getType()) {
-[self.navigationController setNavigationBarHidden:hidden animated:animated];
-[self setNeedsStatusBarAppearanceUpdate];
+void (^animations)(void) = ^{
+ [self setNeedsStatusBarAppearanceUpdate];
+ [self.navigationController setNavigationBarHidden:hidden animated:animated];
+};
+if (animated) {
+ [UIView animateWithDuration:UINavigationControllerHideShowBarDuration delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:animations completion:nil];
+} else {
+ animations();
[[HipChatOSXApp instance] updatePresenceWithStatus:@"status"];