Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 18:14 (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 / app.js
Last active October 30, 2017 18:41
Appcelerator Titanium Mobile: Formatting Strings the correct way using printf From http://www.tidev.io/2015/01/26/formatting-strings-the-correct-way-using-an-old-friend-printf/
String.prototype.printf = function (obj) {
var useArguments = false,
_arguments = arguments,
i = -1;
if (typeof _arguments[0] == 'string') {
useArguments = true;
}
@kbshl
kbshl / ALLOY.md
Last active January 20, 2017 21:48 — forked from FokkeZB/ALLOY.md
If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

Well, you can:

var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;

The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.

var Test = {
name: 'test',
 
init: function(){
this.proxiedHandleEvents = $.proxy(this.handleEvents, this);
Ti.App.addEventListener('app', this.proxiedHandleEvents);
},
 
// Event cannon with callback fix.
fire: function(opts){
@kbshl
kbshl / find_files_cli.sh
Created April 22, 2015 10:08
Find files in folder and output path to cli or file
find ./ -iname "*.extension"
# pipe output into file
find ./ -iname "*.html" > filename.ext
@kbshl
kbshl / change_android_keystore_entry_password.sh
Last active October 30, 2017 18:34
Top used Android keytool commands
keytool -keypasswd -alias <ALIAS> -keystore <KEYSTORE>
@kbshl
kbshl / zip_directory.sh
Created September 30, 2015 12:09
Mac bash zip directory without Mac resource files such as "_MACOSX" or "._Filename" and .ds store files
zip -r -X <OUTPUT_ZIP_PATH> <DIR_TO_COMPRESS_PATH>
@kbshl
kbshl / npm_global_packages.sh
Created October 1, 2015 12:21
Listing globally installed NPM packages and version
npm list -g --depth=0
@kbshl
kbshl / add_ssh_agent_key.sh
Created October 5, 2015 15:59
SSH Agent commands
# addd SSH key to SSH agent
ssh-add ~/.ssh/identity