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 | |
file=/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness | |
max_file=/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/max_brightness | |
level=$(cat $file) | |
changement_level=10 | |
function change_brightness |
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 | |
# By Loic Lefloch | |
# Many thanks to crunchbang community and other contributors | |
#================================================================================ | |
# Some user-defined values | |
MIXERNAME="Master" # The name of the amixer master device | |
GRANULARITY=32 # The approximate number of possible volume positions allowed | |
# aosd options |
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 ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate { | |
@IBOutlet weak var dividerPickerViewContainer: UIView! | |
var dividerPickerView: UIPickerView = UIPickerView() | |
override func viewDidLoad() { | |
// dividerPicker | |
self.dividerPickerView.delegate = self | |
self.dividerPickerView.dataSource = 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
func viewDidLoad() { | |
super.viewDidLoad() | |
// Register to this notifications for handle reduction of the app | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appWillResignActive"), name: UIApplicationWillResignActiveNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("appWillTerminate"), name: UIApplicationWillTerminateNotification, object: nil) | |
// Call end editing when the user tap on the screen but not in the keyboard or the text edit | |
var tapGesture = UITapGestureRecognizer(target: self, action: Selector("endEditing:")) | |
// prevents the scroll view from swallowing up the touch event of child buttons |
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 String | |
{ | |
var length: Int { | |
get { | |
return count(self) | |
} | |
} | |
func contains(s: String) -> Bool | |
{ |
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
override func viewWillAppear(animated: Bool) { | |
super.viewWillAppear(animated) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWasShown:", name: UIKeyboardWillShowNotification, object: nil) | |
NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillBeHidden:", name: UIKeyboardWillHideNotification, object: nil) | |
} | |
override func viewWillDisappear(animated: Bool) { | |
NSNotificationCenter.defaultCenter().removeObserver(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
import Foundation | |
infix operator =~ {} | |
func =~ (input: String, pattern: String) -> Bool { | |
return Regex(pattern).test(input) | |
} | |
class Regex { | |
let internalExpression: NSRegularExpression |
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 | |
namespace Example\ApiBundle\Controller; | |
use FOS\RestBundle\Controller\FOSRestController; | |
use FOS\RestBundle\View\View; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Serializer\Exception\LogicException; | |
use Symfony\Component\Validator\ConstraintViolation; |
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
.text-xs-left { text-align: left; } | |
.text-xs-right { text-align: right; } | |
.text-xs-center { text-align: center; } | |
.text-xs-justify { text-align: justify; } | |
@media (min-width: 768px) { | |
.text-sm-left { text-align: left; } | |
.text-sm-right { text-align: right; } | |
.text-sm-center { text-align: center; } | |
.text-sm-justify { text-align: justify; } |
OlderNewer