Instantly share code, notes, and snippets.

View gist:ccad2a2d93782ef94f8b8de61dbeb173
"schedule": {
nextLessonDate = "<null>";
todayLessons = (
{
endTime = 1536821100;
number = 1;
place = "<null>";
startTime = 1536818400;
subject = {
id = 2130549290864177;
View gist:a3b21ffa3c0ae9c25674cf530a9a5446
NSDictionary *dataOptions = @{NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute : @(NSUTF8StringEncoding)};
NSData *textData = [text dataUsingEncoding:NSUTF8StringEncoding];
NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithData:textData options:dataOptions documentAttributes:nil error:nil];
if (attributedText) {
[attributedText enumerateAttributesInRange:NSMakeRange(0, [attributedText length]) options:NSAttributedStringEnumerationLongestEffectiveRangeNotRequired usingBlock:^(NSDictionary<NSAttributedStringKey,id> * _Nonnull attrs, NSRange range, BOOL * _Nonnull stop) {
for (NSString *key in [attrs allKeys]) {
id value = [attrs objectForKey:key];
if ([key isEqualToString:NSFontAttributeName]) {
UIFont *currentFont = (UIFont *)value;
View gist:b1fd8b7c569bb968264dbb627716cfef
// index == indexPath.row, по мере заполнений таблицы увеличивается
// идем по всем дням (в твоем случае по домашкам)
for (DNVPeriodDay *periodDay in period.days) {
// если индекс больше чем кол-во оценок (в твоем случае аттачей)
// то вычитаем их кол-во плюс один из индекса
// плюс один потому что к оценкам есть хедер (в твоем случае описание домашки)
// вычитаем и берем следующий день (в твоем случае домашку)
// это значит что индекс уже перешел этот день и показал его содержимое
if (index > [periodDay.marks count]) {
View gist:3c33f4dc6f255cc5b6a20a840eb5c08a
{
Notifications = (
{
AuthorFirstName = "\U0410\U043b\U0435\U043a\U0441\U0430\U043d\U0434\U0440\U0430";
AuthorImageUrl = "https://t1.csdnevnik.ru/user-avatar/b70acc5b575e4d5abb560a06098921a4.jpg?d=20170817042248";
AuthorLastName = "\U0424\U0438\U0440\U0441\U043e\U0432\U0430";
AuthorMiddleName = "\U0421\U0435\U0440\U0433\U0435\U0435\U0432\U043d\U0430";
CommentsCount = 0;
CreatedDateTime = 1523890413;
EventKey = "schoolNotification_1394814742021277656";
View gist:77d0333e56e45a45aa14664df7beacd7
{
Comments = (
{
AuthorID = 1000001036529;
Comments = (
);
CreatedDateTime = 1523723492;
HasPrevious = 0;
ID = 5298;
IsDeleted = 0;
View gist:4c1059b4fdf2728cfecc4b060154cee0
{
AuthorID = 1000001036529;
Comments = (
{
AuthorID = 1000001036529;
Comments = (
);
CreatedDateTime = 1523723512;
HasPrevious = 0;
ID = 5302;
View gist:d08ff030498c8ae4647c359b90dd0590
Comments = (
{
AuthorID = 10000500;
Comments = (
{
AuthorID = 10000501;
Comments = "<null>";
CreatedDateTime = 1522800004;
HasPrevious = 0;
ID = 20000503;
View gist:1646ee8c2aebb752de2e454bde6913f3
func updateLocationoordinates(coordinates:CLLocationCoordinate2D) {
if let circle = createOfferCircle {
if tempCount == 1 {
tempCount = 0
animateCoordinate = coordinates
startAnimated(fromPosition: circle.position, to: coordinates)
} else {
tempCount = tempCount + 1
}
View gist:d672c75367ca941419463b1caa0cec7d
// UIGestureRecognizerDelegate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
self.shouldPassTouches = YES;
return YES;
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
self.shouldPassTouches = NO;
return YES;
View gist:b721d3e4ba95895d7f951db65a868f4b
{
"forward": {
"requestedUser": {
"connected": 1,
"userId": 138,
"type": "member",
"busyState": 1,
"status": "online",
"broadcasting": 0,
"id": "5a3b609a2e0f4650df6841ba",