Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 02:23 (UTC +01:00)
  • X @iskostja
View GitHub Profile
@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 / get_known_host_entry.sh
Created August 14, 2017 10:09
Get SSH known_host entry for domain
ssh-keyscan -t rsa exmaple.com
@kbshl
kbshl / gist:21fd9de4441daec6c50063c65263bc26
Created August 7, 2017 15:08 — forked from aaronksaunders/gist:389b209cf9499b0b1a86
[Appcelerator Titans] Auto increment <version> in tiapp.xml
From:
Chris Barber <cbarber@appcelerator.com>
To:
"Jerry.Porter@gulfstream.com" <Jerry.Porter@gulfstream.com>,
"titans@lists.appcelerator.org" <titans@lists.appcelerator.org>,
Date:
04/09/2014 01:21 AM
Subject:
Re: [Appcelerator Titans] Auto increment <version> in tiapp.xml
@kbshl
kbshl / switch_xcode.sh
Last active October 30, 2017 18:30
Switch Xcode version from CLI
# print current selected Xcode path
xcode-select --print-path
# switch to another version of Xcode
sudo xcode-select --switch /PATH/TO/YOUR/OTHER/XCODE/Xcode45.app
# switch back to main Xcode version / installation
sudo xcode-select --switch /Applications/Xcode.app
# 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 / move_softkeyboard_up.js
Created March 6, 2017 08:41
Appcelerator iOS: Move TableView up if soft keyboard comes up
var isKeyboardOpen = false; // used for the iOS keyboard open detection later.
// handles the iOS keyboard change event.
function onKeyboardFrameChanged(event) {
// first, calculate the new position.
var newListBottomPosition;
if (isKeyboardOpen) {
isKeyboardOpen = false;
var FileModel = function() {
this.saveImage = function($blob, $callback, $error) {
console.log("saveImage", $blob.mimeType);
var request = Titanium.Network.createHTTPClient({
onload: function(e) {
$callback(JSON.parse(this.responseText));
},
onerror: function(e) {
$error(e.message);
public class HomeActivity extends Activity {
...
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
switch (keyCode){
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
@kbshl
kbshl / show_hide_overflow_menu_with_toolbar.java
Created November 25, 2016 15:53
Change the behavior of the hardware menu button when it is present to show/hide the toolbar overflow menu - From http://stackoverflow.com/questions/27362030/toolbar-overflow-menu-button-always-showing
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_MENU) {
if (mToolbar.isOverflowMenuShowing()) {
mToolbar.hideOverflowMenu();
}
else {