Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 14:04 (UTC +02:00)
  • X @iskostja
View GitHub Profile
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
# First, unzip the APK and extract the file /META-INF/ANDROID_.RSA (this file may also be CERT.RSA, but there should only be one .RSA file).
# Then issue this command:
keytool -printcert -file ANDROID_.RSA
# You will get certificate fingerprints like this:
# MD5: B3:4F:BE:07:AA:78:24:DC:CA:92:36:FF:AE:8C:17:DB
# SHA1: 16:59:E7:E3:0C:AA:7A:0D:F2:0D:05:20:12:A8:85:0B:32:C5:4F:68
# Signature algorithm name: SHA1withRSA
@kbshl
kbshl / lc_in_visualforce_page.js
Created October 30, 2017 18:52
JS for Lightning Component in Visualforce Page
(function constructor() {
let recordId = '{!Assignment__c.Id}';
let userContext = '{!$User.UITheme}';
$Lightning.use('c:HotelCheckInApp', function _createHotelCheckInComponent() {
$.Lightning.createComponent('c:HotelCheckIn', { recordId: recordId }, 'lightningComponent', function _handleCreatedComponent(component) {
console.info('HotelCheckIn Lightning Component created');
});
});
}());
@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 / adbDatabasePull.sh
Last active October 30, 2017 18:41
Android: Pull database form emulator per adb command
# on genymotion emulator adb has root access
# also possible for directories
adb pull /data/data/<package_name>/databases/<database_name> <local_file_path>
@kbshl
kbshl / androidPrefs.js
Last active October 30, 2017 18:40 — forked from IGx89/android_prefs
Titanium Mobile: Emulates the standard Android preferences grid
// the following code is both the logic and examples of using it
var win = Titanium.UI.currentWindow;
// I've set anyDensity to true in my app and this function enables the UI to properly scale
// you can safely delete this function and all references to it if you'd like
var adj = function(pixels) {
if(Titanium.Platform.name == 'iPhone OS') {
return pixels;
} else {
@kbshl
kbshl / eventTracking.js
Last active October 30, 2017 18:40
Titanium Mobile: Fire Google Analytics Event
// fire analytics event
require('/helpers/analytics/ga').event(CATEGORY, ACTION, LABEL, 1);
@kbshl
kbshl / app.js
Last active October 30, 2017 18:40
Titanium Mobile: Fire Google Analytics Screen View
// fire tracking event
require('/helpers/analytics/ga').screen(SCREENNAME);
@kbshl
kbshl / app.js
Last active October 30, 2017 18:40 — forked from FokkeZB/app.js
Titanium Mobile: Add event listener once respectively remove event listener for anonymous callback function
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
win.addEventListener('click', function foo(e) { // note the named function expression needed for the second way
// oringal idea by @fukhaos
// http://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/#comment-13013
e.source.removeEventListener(e.type, arguments.callee);
@kbshl
kbshl / shell
Last active October 30, 2017 18:39 — forked from rborn/gist:63113167aace181f4f8b
Delete iOS8 simulator NSUserDefaults (Ti.App.Properties) on app uninstall
Delete this file
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/SIM_UDID/data/Library/Preferences/APP_ID.plist