// as UISearchBar extension
extension UISearchBar {
func changeSearchBarColor(color : UIColor) {
for subView in self.subviews {
for subSubView in subView.subviews {
if subSubView.conformsToProtocol(UITextInputTraits.self) {
let textField = subSubView as UITextField
textField.backgroundColor = color
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
http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload | |
extension UIImage { | |
func fixOrientation() -> UIImage { | |
if (self.imageOrientation == UIImageOrientation.Up) { | |
return 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
# http://pablin.org/2015/05/27/re-enable-alcatraz-on-xcode-6-dot-3-2-or-newer/ | |
# To read restriction: | |
defaults read com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-6.x | |
# To enable: | |
defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-6.x | |
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
Para hacer correr odoo: | |
# 1. Levantar boot2docker: | |
boot2docker up | |
# 2. hacer correr los exports que te salen (si es que te presenta) | |
# 3. Solo la primera vez! | |
======================== |
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
# http://stackoverflow.com/questions/1628088/reset-my-local-repository-to-be-just-like-remote-repository-head | |
# http://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1 | |
git fetch origin | |
git reset --hard origin/master | |
# Optionally | |
git reset --hard HEAD |
http://www.folio3.com/blog/change-status-bar-color-ios-app/
- Open the info.plist file of your app and set the UIViewControllerBasedStatusBarAppearance to NO
- Put this in app delegate:
// Status Bar Color
UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
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
# http://raspberrypi.stackexchange.com/questions/311/how-do-i-backup-my-raspberry-pi | |
diskutil list | |
# backup: | |
sudo dd if=/dev/disk2 of=raspberrypi20151118.img bs=1m | |
# restore: | |
dd if=sd.img of=/dev/sdb bs=4M |
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 DetailActivity extends AppCompatActivity implements MediaPlayer.OnPreparedListener | |
... | |
private MediaPlayer mediaPlayer; | |
... | |
// Setup MediaPlayer | |
mediaPlayer = new MediaPlayer(); | |
mediaPlayer.setOnPreparedListener(this); | |
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); | |
try { | |
mediaPlayer.setDataSource(REPLACE_WITH_SOME_URL_RESOURCE); |
<changeSet id="20161231000001" author="jhipster">
<sql>SET FOREIGN_KEY_CHECKS=0;</sql>
<loadData encoding="UTF-8"
file="config/liquibase/enterprises.csv"
separator="|"
tableName="enterprise">