This file contains 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 aimed to simplify the implementation of datasource methods for table or collection | |
views where the data is an array. | |
This allows us to re-use code and slim our view Controllers. | |
*/ | |
import Foundation | |
import UIKit | |
class ArrayDataSource<CellType: UIView, ItemType>: NSObject, UITableViewDataSource, UICollectionViewDataSource { | |
var items: [ItemType] |
This file contains 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
/** | |
CollectionType and MutableCollectionType extensions to be able to easily shuffle | |
items | |
*/ | |
import Foundation | |
extension CollectionType { | |
/// Return a copy of "self" with its elements shuffled | |
func shuffle() -> [Generator.Element] { | |
var list = Array(self) |
This file contains 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
/** | |
UIFont extensions to be able to get bold and bold italic fonts directlky | |
from a UIFont object | |
*/ | |
import Foundation | |
import UIKit | |
extension UIFont { | |
func withTraits(traits:UIFontDescriptorSymbolicTraits...) -> UIFont { |
This file contains 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 UIView { | |
/** | |
Rounds the given set of corners to the specified radius | |
- parameter corners: Corners to round | |
- parameter radius: Radius to round to | |
*/ | |
func roundCorners(corners: UIRectCorner, radius: CGFloat) { | |
_roundCorners(corners, radius: radius) | |
} |
This file contains 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
<?php | |
$scope = 'https://www.googleapis.com/auth/analytics.readonly'; | |
$jsonKeyFilePath = '../config/client_secrets.json'; | |
$client = new \Google_Client(); | |
$client->setScopes([$scope]); | |
$client->setAuthConfigFile($jsonKeyFilePath); | |
$client->useApplicationDefaultCredentials(); | |
$client->fetchAccessTokenWithAssertion(); |
This file contains 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
gapi.analytics.ready(function() { | |
/** | |
* Authorize the user with an access token obtained server side. | |
*/ | |
gapi.analytics.auth.authorize({ | |
'serverAuth': { | |
'access_token': '{{ token.access_token }}' | |
} | |
}); |
This file contains 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
php: | |
install: '1' | |
settings: | |
version: '70' | |
modules: | |
php: | |
- cli | |
- intl | |
- mbstring | |
- opcache |
This file contains 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
apache: | |
install: '1' | |
settings: | |
version: 2.4 | |
user: www-data | |
group: www-data | |
default_vhost: false | |
manage_user: false | |
manage_group: false | |
sendfile: 0 |
This file contains 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
<?php | |
public function getCacheDir() | |
{ | |
if (in_array($this->environment, array('dev', 'test'))) { | |
return '/dev/shm/votre_appli/cache/' . $this->environment; | |
} | |
return parent::getCacheDir(); | |
} |
This file contains 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
sync_type: nfs #default | |
nfs: | |
mount_options: ['nfsvers=3','vers=3','actimeo=1','rsize=8192','wsize=8192','timeo=14','rw', 'vers=3', 'tcp'] | |
linux__nfs_options: ['rw','no_subtree_check','all_squash','async'] |
OlderNewer