Skip to content

Instantly share code, notes, and snippets.

🛠
*react->redux

Sean Zhang sean7218

🛠
*react->redux
Block or report user

Report or block sean7218

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UIFont_Family.swift
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"]
View SnappingCollectionViewLayout.swift
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)
@sean7218
sean7218 / UIImageView.swift
Created Aug 13, 2018
load the image from url
View UIImageView.swift
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
}
}
}
View checkbox.mm
- (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]]) {
View midterm.c
#include <stdio.h>
int main(){
printf("HELLO WORLD\n");
return 0;
}
View draft.py
class StackView(View):
def get(request):
return render(request, 'stacker/stack.html', context)
You can’t perform that action at this time.