Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 18:12 (UTC +02:00)
  • X @iskostja
View GitHub Profile
@kbshl
kbshl / exportipa.sh
Created November 19, 2014 14:48
iOS: Exports an .xcarchive into an .ipa file.
xcodebuild -exportArchive -archivePath <PATH_TO_MY.xcarchive> -exportPath <PATH_TO_EXPORTED_IPA> -exportFormat ipa -exportProvisioningProfile "<PROFILE_NAME>"
@kbshl
kbshl / disable_google_chrome_swipe_navigtion.sh
Created December 11, 2014 15:44
Disable Google Chrome two finger forward / backward swipe navigation for Magic Mouse
# open terminal paste snippet and click enter
# disables swipe navigation only for Google Chrome
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE
@kbshl
kbshl / uninstall_adb.sh
Last active October 15, 2015 14:15
Uninstall Android from adb connected device
# start app uninstall intent on device
adb shell am start -a android.intent.action.DELETE -d package:<PACKAGENAME>
# uninstall app instantly from device per cli
adb uninstall <PACKAGENAME>
@kbshl
kbshl / colors.xml
Created October 16, 2015 11:40
opaque Actionbar with AppCompat-v7 21
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="actionbar_opaque">#66000000</color>
<color name="statusBar">#9C9C9C</color>
<color name="primaryDark">#9C9C9C</color>
<color name="primary">#b2b2b2</color>
<color name="activated">#ef0000</color>
<color name="textPrimary">#ffffff</color>
@kbshl
kbshl / adb_capture_screenshot.sh
Last active October 20, 2015 13:54
ADB: capture screenshot directly to Mac from connected device
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/adb.screenshot.png
@kbshl
kbshl / google_maps_js_api_center.js
Created October 27, 2015 15:18
Google MAP API v3: Center & Zoom on displayed markers Source: http://stackoverflow.com/a/2819013
// map: an instance of GMap3
// latlng: an array of instances of GLatLng
var mapBounds = new google.maps.LatLngBounds();
latlng.each(function(n) {
mapBounds.extend(n);
return;
});
@kbshl
kbshl / theme.xml
Created November 25, 2015 17:16
How to change color of the back arrow in the new material theme (AppCompat v21) Source: http://stackoverflow.com/a/27517878
<style name="MyTheme" parent="Theme.AppCompat.Light">
<item name="actionBarTheme">@style/MyApp.ActionBarTheme</item>
<!-- color for widget theming, eg EditText. Doesn't effect ActionBar. -->
<item name="colorControlNormal">@color/MY_AWESOME_COLOR</item>
</style>
<style name="MyApp.ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.ActionBar">
@kbshl
kbshl / Q&A
Created February 12, 2016 14:37
Android orientation locking for Titanium - Originally posted on http://bencoding.com/2016/02/11/android-orientation-locking-for-titanium/
Q: Why lock at the Android Activity level, isn’t adding the Alloy style enough?
A: Unfortunately no. The Alloy style is applied after the window is created. So
if the device is held in a landscape orientation you will see the window open and
turn. Locking at the Android Activity level stops this behavior.
Q: Does this mean all of my Ti.UI.Window object will be locked in portrait?
A: Yes, this locks both at the Android Activity and Titanium object levels.
Q: Can I later change the orientation by updating my Ti.UI.Window orientation?
A: No, orientation is locked at the Android Activity level as well.
@kbshl
kbshl / reset_ios_sim.sh
Created March 7, 2016 13:42
Resetting the iOS Simulator
xcrun simctl erase all
@kbshl
kbshl / uninstall_ios_sim.sh
Created April 14, 2016 18:21
Uninstall app with given bundle identifier from booted simulator
xcrun simctl uninstall booted <BUNDLE_IDENTIFIER>