Skip to content

Instantly share code, notes, and snippets.

View tobias-kuendig's full-sized avatar

Tobias Kündig tobias-kuendig

View GitHub Profile
@tobias-kuendig
tobias-kuendig / cantons.php
Created December 27, 2021 09:18
Schweizer Kantone als PHP-Array / Swiss cantons as a PHP array
return [
'AG' => 'Aargau',
'AI' => 'Appenzell Innerrhoden',
'AR' => 'Appenzell Ausserrhoden',
'BE' => 'Bern',
'BL' => 'Basel Land',
'BS' => 'Basel Stadt',
'FR' => 'Freiburg',
'GE' => 'Genf / Genève',
'GL' => 'Glarus',
@tobias-kuendig
tobias-kuendig / clock.go
Created November 26, 2019 17:18
Golang Clock Package
package clock
import "time"
// Clock is a wrapper around time functions to make
// time dependent code easily testable.
type Clock struct {
now time.Time
}
@tobias-kuendig
tobias-kuendig / Plugin.php
Last active October 12, 2019 09:44
OFFLINE.Mall: Create custom virtual product files
<?php namespace OFFLINE\MallGiftCards;
use Event;
use OFFLINE\Mall\Models\Category;
use OFFLINE\Mall\Models\Currency;
use OFFLINE\Mall\Models\Discount;
use OFFLINE\Mall\Models\Price;
use OFFLINE\Mall\Models\Product;
use OFFLINE\Mall\Models\ProductFileGrant;
use System\Classes\PluginBase;
@tobias-kuendig
tobias-kuendig / .gitlab-ci.yml
Created October 25, 2018 04:45
Simple golang build with dep on GitLab CI
image: golang:1.10
variables:
CI_SERVER_HOSTNAME: gitlab.com
# CI_SERVER_HOSTNAME: gitlab.selfhosted.tld
cache:
paths:
- ${CI_PROJECT_DIR}/vendor
@tobias-kuendig
tobias-kuendig / 2018_04_09_140000_upgrade_bouncer_tables_to_1dot0.php
Last active April 9, 2018 12:49
Laravel migration to upgrade Bouncer 0.* to v1.0.0-rc.1
<?php
use Illuminate\Support\Collection;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Silber\Bouncer\Database\Models;
/**
* @see https://github.com/JosephSilber/bouncer/issues/274#issuecomment-379740043
*/
@tobias-kuendig
tobias-kuendig / gist:19a266e56672ed798a55f42c596ff75b
Last active May 30, 2017 05:53
Private Internet Access Tray Icons for Elementary OS

Installation

Download the icon files and place them in ~/.pia_manager/pia_tray_files/img/. After restarting the PIA indicator the new icons will be loaded.

wget https://cloud.githubusercontent.com/assets/8600029/26569716/a9b779c2-450c-11e7-9b65-3876aa31e75f.png -O ~/.pia_manager/pia_tray_files/img/icon_c.png
wget https://cloud.githubusercontent.com/assets/8600029/26569722/aed90cea-450c-11e7-97e6-abe0410fd1a5.png -O ~/.pia_manager/pia_tray_files/img/default_app_logo_d.png

wget https://cloud.githubusercontent.com/assets/8600029/26569721/aed510c2-450c-11e7-9338-460c6bb7c1d7.png -O ~/.pia_manager/pia_tray_files/img/default_app_logo.png

@tobias-kuendig
tobias-kuendig / OctoberCmsValetDriver.php
Created February 8, 2017 10:17
October CMS Laravel Valet Driver
<?php
/**
* Save this file as ~/.valet/Drivers/OctoberCmsValetDriver.php
*/
class OctoberCmsValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
@tobias-kuendig
tobias-kuendig / instructions.md
Last active September 28, 2018 22:58
Elementary OS redshift-gtk Indicator Icons
  1. Copy redshift-status-off.svg and redshift-status-on.svg to /usr/share/icons/hicolor/scalable/apps/
  2. Restart redshift-gtk

Or run the following commands:

wget https://gist.github.com/tobias-kuendig/d055892720cf09ae1a9d82075fb0f408/raw/5d3625e5f4ac7686d7b40880a211ee72f74ea3d3/redshift-status-off.svg -O /tmp/redshift-status-off.svg
wget https://gist.github.com/tobias-kuendig/d055892720cf09ae1a9d82075fb0f408/raw/5d3625e5f4ac7686d7b40880a211ee72f74ea3d3/redshift-status-on.svg -O /tmp/redshift-status-on.svg