-
Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.
-
Reset PS3 controller by inserting paperclip into pinhole near L2 button.
-
Connect PS3 controller to Mac with USB cable.
-
Enable Bluetooth.
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
| public class Uniqid { | |
| /*** | |
| * Copy of uniqid in php http://php.net/manual/fr/function.uniqid.php | |
| * @param prefix | |
| * @param more_entropy | |
| * @return | |
| */ | |
| public String uniqid(String prefix,boolean more_entropy) | |
| { |
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
| extension UIImage { | |
| func fixedOrientation() -> UIImage { | |
| if imageOrientation == UIImageOrientation.Up { | |
| return self | |
| } | |
| var transform: CGAffineTransform = CGAffineTransformIdentity | |
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
| extension UIView { | |
| func shake(duration: CFTimeInterval) { | |
| let translation = CAKeyframeAnimation(keyPath: "transform.translation.x"); | |
| translation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) | |
| translation.values = [-5, 5, -5, 5, -3, 3, -2, 2, 0] | |
| let rotation = CAKeyframeAnimation(keyPath: "transform.rotation.z") | |
| rotation.values = [-5, 5, -5, 5, -3, 3, -2, 2, 0].map { | |
| (let degrees: Double) -> Double in | |
| let radians: Double = (M_PI * degrees) / 180.0 |
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
| func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
| cell.contentView.layer.cornerRadius = 2.0 | |
| cell.contentView.layer.borderWidth = 1.0 | |
| cell.contentView.layer.borderColor = UIColor.clear.cgColor | |
| cell.contentView.layer.masksToBounds = true; | |
| cell.layer.shadowColor = UIColor.lightGray.cgColor | |
| cell.layer.shadowOffset = CGSize(width:0,height: 2.0) | |
| cell.layer.shadowRadius = 2.0 | |
| cell.layer.shadowOpacity = 1.0 |