-
Что такое
полиморфизм? -
Что такое *инкапсуляция? Что такое *нарушение инкапсуляции? -
Чем
абстрактныйкласс отличается отинтерфейса? -
Расскажите о
паттерне MVC. Чем отличаетсяпассивнаямодель отактивной?
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
| #define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
| #define UserDefaults [NSUserDefaults standardUserDefaults] | |
| #define NotificationCenter [NSNotificationCenter defaultCenter] | |
| #define SharedApplication [UIApplication sharedApplication] | |
| #define Bundle [NSBundle mainBundle] | |
| #define MainScreen [UIScreen mainScreen] | |
| #define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
| #define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
| #define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
| #define NavBar self.navigationController.navigationBar |
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
| ActiveAdmin.register Project do | |
| # Don't forget to add the image attribute (here thumbnails) to permitted_params | |
| controller do | |
| def permitted_params | |
| params.permit project: [:title, :summary, :description, :thumbnail, :date, :url, :client_list, :technology_list, :type_list] | |
| end | |
| end | |
| form do |f| |
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
| import Foundation | |
| extension String | |
| { | |
| var length: Int { | |
| get { | |
| return countElements(self) | |
| } | |
| } | |
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
| // | |
| // FileUploader.swift | |
| // | |
| // Copyright (c) 2015 Narciso Cerezo Jiménez. All rights reserved. | |
| // Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829// | |
| import Foundation | |
| import Alamofire | |
| private struct FileUploadInfo { |
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
| # thanks to http://exponential.io/blog/2015/01/28/install-cassandra-2_1-on-mac-os-x/ | |
| mkdir -p ~/opt/packages && cd $_ | |
| curl -OL http://downloads.datastax.com/community/dsc.tar.gz | |
| gzip -dc dsc.tar.gz | tar xf - | |
| ln -s ~/opt/packages/dsc-cassandra-3.0.0 ~/opt/cassandra | |
| echo 'if [ -d "$HOME/opt" ]; then | |
| PATH="$PATH:$HOME/opt/cassandra/bin" | |
| fi' >> ~/.bash_profile |
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
| -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
| -- -- | |
| -- mysql -- | |
| -- -- | |
| -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
| -- | |
| -- mysql <http://sqlfiddle.com/#!9/91afb5/2> | |
| -- note: sqlfiddle is very stupid |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
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
| import UIKit | |
| class ChatCollectionViewFlowLayout: UICollectionViewFlowLayout { | |
| private var topMostVisibleItem = Int.max | |
| private var bottomMostVisibleItem = -Int.max | |
| private var offset: CGFloat = 0.0 | |
| private var visibleAttributes: [UICollectionViewLayoutAttributes]? |
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
| import 'package:flutter/material.dart'; | |
| const String words1 = "Almost before we knew it, we had left the ground."; | |
| const String words2 = "A shining crescent far beneath the flying vessel."; | |
| const String words3 = "A red flair silhouetted the jagged edge of a wing."; | |
| const String words4 = "Mist enveloped the ship three hours out from port."; | |
| void main() { | |
| runApp(new MyApp()); | |
| } |