Skip to content

Instantly share code, notes, and snippets.

View sidorov-panda's full-sized avatar
👓

Alexey sidorov-panda

👓
View GitHub Profile
<div id="bs-tiny-widget"></div>
<script>
(function(d){
var w,c=d.createElement('script'),s=d.createElement('link');
c.src='https://bolshayastrana.com/jswidget/tiny/bundle.js';c.type='text/javascript';c.async=!0;c.defer=!0;d.body.appendChild(c);
s.rel='stylesheet';s.href='https://bolshayastrana.com/jswidget/tiny/bundle.css';d.getElementsByTagName('head')[0].appendChild(s);
c.onload=function(){
w = new BsTinyWidget({
target: d.getElementById('bs-tiny-widget'),
props: {
@sidorov-panda
sidorov-panda / UICollectionViewFlowLayoutCenterItem.m
Created July 28, 2017 14:26 — forked from mmick66/UICollectionViewFlowLayoutCenterItem.m
UICollectionViewFlowLayout with arbitrary sized Paging
#import "UICollectionViewFlowLayoutCenterItem.h"
@implementation UICollectionViewFlowLayoutCenterItem
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f;
CGRect proposedRect = self.collectionView.bounds;
import UIKit
class EMCollectionViewFlowLayout: UICollectionViewFlowLayout {
override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
var _proposedContentOffset = CGPoint(x: proposedContentOffset.x, y: proposedContentOffset.y)
var offSetAdjustment: CGFloat = CGFloat.max
let horizontalCenter: CGFloat = CGFloat(proposedContentOffset.x + (self.collectionView!.bounds.size.width / 2.0))
let targetRect = CGRect(x: proposedContentOffset.x, y: 0.0, width: self.collectionView!.bounds.size.width, height: self.collectionView!.bounds.size.height)
@sidorov-panda
sidorov-panda / ocmock-cheatsheet.m
Created October 17, 2015 12:57 — forked from kharmabum/ocmock-cheatsheet.m
OCMock cheatsheet
/*----------------------------------------------------*/
#pragma mark - XCTAsserts
/*----------------------------------------------------*/
XCTAssert(expression, format...);
XCTAssertTrue(expression, format...);
XCTAssertFalse(expression, format...);
XCTAssertEqual(expression1, expression2, format...);
XCTAssertNotEqual(expression1, expression2, format...);
XCTAssertNil(expression, format...);
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.
CGFloat scale = 1.0f;
if ([UIScreen instancesRespondToSelector:@selector(scale)) {
scale = [UIScreen mainScreen].scale;
}
CGDataProviderRef source = CGDataProviderCreateWithData(NULL, ThumbnailSample_2x_png, ThumbnailSample_2x_png_len, NULL);
CGImageRef imageRef = CGImageCreateWithPNGDataProvider(source, NULL, YES, kCGRenderingIntentDefault);
UIImage *image = [UIImage imageWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
CGImageRelease(imageRef);
CGDataProviderRelease(source);
// Declare enums like so:
#define IMAGE_STATUS(XX) \
XX(kDOImageStatusOK, = 0) \
XX(kDOImageStatusCached, )\
XX(kDOImageStatusRetry, )
DECLARE_ENUM(DOImageStatus, IMAGE_STATUS)
Написать простой клиент для Superjob.
Платформы: ios 7+
Верстка: Storyboard+Autolayout;
Cocoa Pods для сторонних библиотек
Поддержка Autorotation
API URL: https://api.superjob.ru/#methods
app_key: r0709abae5013187334987e274e49a191c9b1d7d7ddefaba5482829ff04546d2c5f5286ba
По вопросам: ody344@gmail.com