- Read DataLoader Source
- Check out Keechma's Dataloader and Graphql Builder... (video)
- Check out this example with GraphQL + Express + Dataloader
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
import threading | |
import asyncio | |
async def run_coro_threadsafe(self, coro, other_loop, our_loop = None): | |
"""Schedules coro in other_loop, awaits until coro has run and returns | |
its result. | |
""" | |
loop = our_loop or asyncio.get_event_loop() | |
# schedule coro safely in other_loop, get a concurrent.future back |
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
import asyncio | |
import threading | |
import random | |
def thr(i): | |
# we need to create a new loop for the thread, and set it as the 'default' | |
# loop that will be returned by calls to asyncio.get_event_loop() from this | |
# thread. | |
loop = asyncio.new_event_loop() |
- 테스트앱
- 낮은 해상도 = 사진 크기: 10 ~ 50KB
- 중간 해상도 = 사진 크기: 100 ~ 500KB + 5MB
- 높은 해상도 = 사진 크기: 10 ~ 50MB
- 기본 설정 = 설정: 메모리 100MB 디스크 150MB
- 리사이즈 = (화면 너비 / 3)^2. iPhone 8+ 기준으로 414 pixel.
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
so A and B are structurally identical | |
C reverses the order of the 8 and 32 bit Ints | |
and D substitutes a string for the Int8 | |
then I try to read aaaa’s bits using B C and D overlays 😊 | |
C is printing the 8 bits of the A integer j and then the first 8 bits of integer k but somehow that still works out to one | |
when I hit D it doesn’t find a string so prints a blank | |
but the important point is: it doesn’t check anything, and doesn’t crash |
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
import Foundation | |
import ObjectiveC.runtime | |
let myString = "foobar" as NSString | |
println(myString.description) | |
let myBlock : @objc_block (AnyObject!) -> String = { (sself : AnyObject!) -> (String) in | |
"✋" | |
} |
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
func countLabelLines(label: UILabel) -> Int { | |
// Call self.layoutIfNeeded() if your view uses auto layout | |
let myText = label.text! as NSString | |
let rect = CGSize(width: label.bounds.width, height: CGFloat.greatestFiniteMagnitude) | |
let labelSize = myText.boundingRect(with: rect, options: .usesLineFragmentOrigin, attributes: [NSAttributedStringKey.font: label.font], context: nil) | |
return Int(ceil(CGFloat(labelSize.height) / label.font.lineHeight)) | |
} |
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
var content = UNMutableNotificationContent() | |
content.title = "Title" | |
content.subtitle = "Subtitle" | |
content.body = "Text" | |
content.sound = nil | |
content.categoryIdentifier = "categoryName" | |
var personNameComponents = PersonNameComponents() | |
personNameComponents.nickname = "Sender Name" |
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
#!/bin/bash | |
# | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# | |
# Moving a file in git doesn't track history, so the purpose of this | |
# utility is best explained from the kernel wiki: | |
# | |
# Git has a rename command git mv, but that is just for convenience. | |
# The effect is indistinguishable from removing the file and adding another | |
# with different name and the same content. |
You can't use bridging headers within a framework.
Xcode will automatically create umbrella header for you Cocoa Framework project. That will be the file named <FrameworkName>.h
in the <FrameworkName>
group/folder (where the rest of your sources are).
- To include the required Obj-C header you need to set it as
Public
: select it in the project explorer (left pane) and change the propertyTarget Membership
(left—Inspectors—pane) fromProject
toPublic
. - Open umbrella header (
<FrameworkName>.h
) and import the required header as:
OlderNewer