Skip to content

Instantly share code, notes, and snippets.

View lgraubner's full-sized avatar

Lars Graubner lgraubner

View GitHub Profile
@lgraubner
lgraubner / script.sh
Created October 1, 2019 19:31
Automatically increment Xcode release build number
if [ "$CONFIGURATION" = "Release" ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
fi;
@lgraubner
lgraubner / Button.js
Last active January 30, 2019 09:34
A little helper function to add variant styles to a React component.
const Button = ({ onPress, variant }) => {
const applyVariantStyle = variantStyleFactory(variant)
return (
<TouchableScale
style={[
styles.button,
applyVariantStyle({
small: styles.buttonSmall,
big: styles.buttonBig
@lgraubner
lgraubner / smb.conf
Created April 1, 2018 15:54
Samba share folder without authentication
[share]
path = /media/usb
writable = yes
guest ok = yes
force user = pi
force group = pi
@lgraubner
lgraubner / dnsmasq.conf
Last active August 24, 2018 17:54
Dnsmasq configuration file
# domain needed
bogus-priv
# local domain
local=/fuchsbau.lan/
# listen from local machine and network
listen-address=127.0.0.1
listen-address=192.168.2.2
@lgraubner
lgraubner / alphabet.txt
Last active April 4, 2018 19:57
Password alphabet range
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
# URL safe
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$-_.+!*'(),
@lgraubner
lgraubner / index.js
Last active February 1, 2018 13:20
Simple fetch wrapper
const fetchFromApi = async (..args) => {
const response = await fetch(...args)
if (!response.ok) {
throw Error(response.statusText)
}
return response.json()
}
@lgraubner
lgraubner / base.css
Last active January 23, 2018 19:51
CSS in JS base styles
html {
box-sizing: border-box;
font-size: 100%;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
@lgraubner
lgraubner / Aux.js
Created October 25, 2017 12:09
React helper components
const Aux = ({ children }) => children;
@lgraubner
lgraubner / .editorconfig
Last active October 27, 2017 07:40
Default project setup files
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
@lgraubner
lgraubner / head-cleanup.php
Created September 9, 2017 18:59
Plugin to cleanup Wordpress head
<?php
/*
Plugin Name: WP Head Cleanup
Description: Removes unnecessary head parts
Version: 1.0.0
Author: Lars Graubner
Author URI: https://larsgraubner.com
License: MIT License
*/