Skip to content

Instantly share code, notes, and snippets.

View lgraubner's full-sized avatar

Lars Graubner lgraubner

View GitHub Profile
@lgraubner
lgraubner / expires.conf
Created August 3, 2016 10:49
Caching rules for nginx
# Expire rules for static content
# No default expire rule. This config mirrors that of apache as outlined in the
# html5-boilerplate .htaccess file. However, nginx applies rules by location,
# the apache rules are defined by type. A consequence of this difference is that
# if you use no file extension in the url and serve html, with apache you get an
# expire time of 0s, with nginx you'd get an expire header of one month in the
# future (if the default expire rule is 1 month). Therefore, do not use a
# default expire rule with nginx unless your site is completely static
@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 / 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 / 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 / index.html
Last active February 22, 2018 12:23
Barebones html template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<meta name="description" content="">
@lgraubner
lgraubner / webpack.config.js
Created June 9, 2017 20:03
Webpack image processing sample configuration
const webpackConfig = {
entry: './app/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.css$/,
@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;
}