This file contains hidden or 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
extension SandboxActionCreator where S == TestScheduler { | |
convenience init(environment: PluginEnvironment) { | |
self.init(environment: environment, scheduler: TestScheduler()) | |
} | |
} | |
class SandboxPluginTests: XCTestCase { | |
func test() { | |
enum CustomError: Error { | |
case timeout |
This file contains hidden or 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
image: nikolaik/python-nodejs:latest | |
stages: | |
- install | |
- test | |
- deploy | |
prodInstall: | |
stage: install | |
script: |
This file contains hidden or 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
for family in UIFont.familyNames.sorted() { | |
let name = UIFont.fontNames(forFamilyName: family) | |
print("Family \(family) and Name: \(name)") | |
} | |
/* | |
Family Academy Engraved LET and Name: ["AcademyEngravedLetPlain"] | |
Family Al Nile and Name: ["AlNile", "AlNile-Bold"] | |
Family American Typewriter and Name: ["AmericanTypewriter-CondensedBold", "AmericanTypewriter-Condensed", "AmericanTypewriter-CondensedLight", "AmericanTypewriter", "AmericanTypewriter-Bold", "AmericanTypewriter-Semibold", "AmericanTypewriter-Light"] |
This file contains hidden or 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
class SnappingCollectionViewLayout: UICollectionViewFlowLayout { | |
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { | |
guard let collectionView = collectionView else { return super.targetContentOffset(forProposedContentOffset: proposedContentOffset, withScrollingVelocity: velocity) } | |
var offsetAdjustment = CGFloat.greatestFiniteMagnitude | |
let horizontalOffset = proposedContentOffset.x + collectionView.contentInset.left | |
let targetRect = CGRect(x: proposedContentOffset.x, y: 0, width: collectionView.bounds.size.width, height: collectionView.bounds.size.height) | |
This file contains hidden or 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
extension UIImageView { | |
func load(url: URL) { | |
DispatchQueue.global().async { [weak self] in | |
if let data = try? Data(contentsOf: url) { | |
if let image = UIImage(data: data) { | |
DispatchQueue.main.async { | |
self?.image = image | |
} | |
} | |
} |
This file contains hidden or 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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { | |
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; | |
} | |
if ([selectedRowsArray containsObject:[contentArray objectAtIndex:indexPath.row]]) { |
This file contains hidden or 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
#include <stdio.h> | |
int main(){ | |
printf("HELLO WORLD\n"); | |
return 0; | |
} |
This file contains hidden or 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
class StackView(View): | |
def get(request): | |
return render(request, 'stacker/stack.html', context) | |