Skip to content

Instantly share code, notes, and snippets.

View dbasedow's full-sized avatar

Daniel Basedow dbasedow

  • Aeditive
  • Hamburg, Germany
View GitHub Profile
@dbasedow
dbasedow / i3-keyboard-setup.sh
Created March 5, 2020 15:43
Use multiple keyboards with different layouts at the same time
setxkbmap_by_name() {
ID=`xinput -list --id-only "$1"`
shift 2
`setxkbmap -device $ID "$@"`
}
setxkbmap_by_name "daskeyboard" -layout de
setxkbmap_by_name "Topre Corporation HHKB Professional" -layout us
@dbasedow
dbasedow / KeyboardHandler.js
Created May 28, 2016 09:11
Keyboard spacing solution for react-native based on the stackoverflow answer http://stackoverflow.com/a/33585501/1783214
/**
* Based on http://stackoverflow.com/a/33585501/1783214
*
* Handle resizing enclosed View and scrolling to input
* Usage:
* <KeyboardHandler ref='kh' offset={50}>
* <View>
* ...
* <TextInput ref='username'
* onFocus={()=>this.refs.kh.inputFocused(this,'username')}/>
@dbasedow
dbasedow / WebViewResizing.js
Last active September 26, 2022 18:55
Resize WebView to content height in react-native
'use strict';
var React = require('react');
var ReactNative = require('react-native');
var {AppRegistry, Text, WebView, View, Dimensions} = ReactNative;
var WebViewResizing = React.createClass({
getInitialState: function () {
return {
webViewHeight: 100 // default height, can be anything