Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Grüßung gruessung

View GitHub Profile
@gruessung
gruessung / index.php
Created April 5, 2018 08:40
OSM PHP Cache
View index.php
<?php
if (strpos($_SERVER['HTTP_REFERER'], 'yourdomain.com') === false) {
header('HTTP/1.0 403 Forbidden');
die('forbidden for '.$_SERVER['HTTP_REFERER']);
}
header('Access-Control-Allow-Origin: *');
$sSub = $_GET['sub'];
$iZ = $_GET['z'];
$iY =$_GET['y'];
@gruessung
gruessung / add_domain.sh
Last active October 30, 2018 10:22
This script generate a yourdomain.conf in /etc/nginx/sites-enabled/ and generate a Let's Encrypt certificate with certbot (You have to install certbot manually!)
View add_domain.sh
#!/bin/bash
# Shell script to add a subdomain to nginx with let's encrypt
DOMAIN=""
PROXY=false
DOCROOT="/var/www/html/"
function usage()
{
@gruessung
gruessung / DatabaseHelper.java
Created July 26, 2017 14:28
Android DatabaseHelper Class
View DatabaseHelper.java
package de.gvisions.solardorf.service;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DatabaseHelper extends SQLiteOpenHelper {
private Context context;
@gruessung
gruessung / designer.html
Last active August 29, 2015 14:13
designer
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">