Skip to content

Instantly share code, notes, and snippets.

View wavecos's full-sized avatar

Jose Alfredo Arias S. wavecos

View GitHub Profile
@wavecos
wavecos / ios-statusbar-color.md
Last active August 29, 2015 14:26
Change status bar color

Change status bar color in iOS

http://www.folio3.com/blog/change-status-bar-color-ios-app/

  1. Open the info.plist file of your app and set the UIViewControllerBasedStatusBarAppearance to NO
  2. Put this in app delegate:
  // Status Bar Color
  UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)
@wavecos
wavecos / git-reset-repository
Created July 1, 2015 12:56
git: Reset Local Repository (undo changes) like HEAD
# 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
@wavecos
wavecos / gist:0ce4bc9fc0b6ad8a8323
Created June 24, 2015 22:43
Hacer correr docker con Odoo en Mac OS
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!
========================
@wavecos
wavecos / enable-alcatraz
Last active September 21, 2015 01:24
Enable Alcatraz in XCode 6.x or XCode 7.x
# 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
@wavecos
wavecos / gist:8718bd15064a1b688f92
Last active February 14, 2021 23:25
Fix Image Orientation, Rotation #swift #ios
http://stackoverflow.com/questions/5427656/ios-uiimagepickercontroller-result-image-orientation-after-upload
extension UIImage {
func fixOrientation() -> UIImage {
if (self.imageOrientation == UIImageOrientation.Up) {
return self;
}
@wavecos
wavecos / ios-uisearchbar-background-color.md
Last active November 19, 2021 00:09
Customize Color, background from UISearchBar in Swift

Customize Color, background from UISearchBar in Swift

// 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
@wavecos
wavecos / gist:147a07a310e69412f16c
Created February 2, 2015 01:04
Get File Name from Swift Class (or Objective C class)
NSLog("Filename: " + NSStringFromClass(self.dynamicType))
@wavecos
wavecos / gist:4dcb1410a41b9dd521cb
Created January 28, 2015 23:13
Present Modal ViewController when tap a TabBarItem (like camera VC in Instagram)
// 1. First Create a Dummy UIViewController that has a root relation with the UITabBarController
// 2. Make this controller implement a UITabBarControllerDelegate
// 3. In ViewDidLoad:
override func viewDidLoad() {
super.viewDidLoad()
self.tabBarController?.delegate = self
}
// 4. Implement this delegate method:
func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) {
let isModalTab = viewController == self
@wavecos
wavecos / gist:9834c046fb7aeb608288
Created November 11, 2014 15:24
Get the version name for Ubuntu Linux
cat /etc/issue
@wavecos
wavecos / gist:9147d4627e3af5c9f9bf
Last active February 14, 2021 23:25
Change NavigationBar title without self.title
self.navigationController.navigationBar.topItem.title = _venue.name;