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
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
/** | |
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
/** | |
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
/** | |
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
{ | |
"name": "jaytaph/security-example", | |
"require": { | |
"symfony/security-core": "~2.8" | |
}, | |
"authors": [ | |
{ | |
"name": "Joshua Thijssen", | |
"email": "[email protected]" | |
} |
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
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |