Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Niess dakira

View GitHub Profile
@dakira
dakira / PHPUnitTestMethodPlugin.py
Created May 27, 2021
This plugin allows you to convert a regular sentence to a PHPUnit test method.
View PHPUnitTestMethodPlugin.py
# Create a file called PHPUnitTestMethodPlugin.py in Plugins/ within your Sublime Text Packages folder
# You can run this via Sublime's console with: view.run_command("php_unit_test_method")
# You can bind it to ctrl+e as a regular command
import sublime
import re
import sublime_plugin
class PhpUnitTestMethodCommand(sublime_plugin.TextCommand):
def run(self, edit, lines = 10):
@dakira
dakira / dm-diapers.js
Last active Mar 12, 2021 — forked from marco79cgn/dm-toilet-paper-wheat-flour.js
ios widget to show number of diapers at dm market
View dm-diapers.js
// dm Windel Widget
// Basiert auf
// dm Klopapier Widget
// https://gist.github.com/marco79cgn/23ce08fd8711ee893a3be12d4543f2d2
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
@dakira
dakira / run_internet.sh
Created Jul 8, 2020
Let script wait for internet connectivity
View run_internet.sh
#!/bin/sh
while ! ping -c 1 -W 1 8.8.8.8; do
sleep 1
done
curl -X POST https://maker.ifttt.com/trigger/pump/with/key/hfjrufjehgfhjgefgegf
@dakira
dakira / class.sublime-snippet
Last active May 27, 2021
Sublime Text Snippets
View class.sublime-snippet
<snippet>
<content><![CDATA[
<?php
class ${TM_FILENAME/(.+)\..+|.*/$1/:name}
{
${0}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
@dakira
dakira / upgrade.yml
Created Aug 18, 2017 — forked from kiview/upgrade.yml
Ubuntu upgrade with Ansible
View upgrade.yml
---
- hosts:
- all
become: true
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Upgrade packages
apt: upgrade=dist
View keybase.md

Keybase proof

I hereby claim:

  • I am dakira on github.
  • I am mniess (https://keybase.io/mniess) on keybase.
  • I have a public key ASBAaZEJcvp5Oumr0JV6tVTaJIR18BbnLCXXIh7kbr4TaAo

To claim this, I am signing this object:

@dakira
dakira / provision1604.sh
Last active Sep 6, 2017
Basic provisioning for Ubuntu 16.04
View provision1604.sh
#!/bin/bash
apt update && apt -y full-upgrade
apt-get install -y joe-jupp mosh byobu software-properties-common \
php7.0-intl php7.0-ldap php7.0-mcrypt php7.0-zip php7.0-soap \
python-setuptools python-simplejson python-imaging python-mysqldb python-flup \
language-pack-de language-pack-en
update-locale LANG=de_DE.UTF-8 LC_MESSAGES=POSIX
View migrate_mysq4to5.sh
#
# MIGRATE MySQL4 DATABASES TO MySQL5 - Steps for dumping and converting
#
# Uses mysqldump and patches output to be compatible with MySQL 5.5+ (? - no sure
# at which specific release of MySQL 5 the old style syntax support ended).
#
# Conversion is most likely incomplete. It does some essential converting where
# I regularly experienced problems during migration.
#
# Use on own risk, always try with test databases first. No warranty at all!
@dakira
dakira / after.sh
Last active Aug 29, 2015
homstead script to run after provisioning
View after.sh
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
if [ ! -f /usr/local/extra_homestead_software_installed ]; then
apt-get -y install zsh joe-jupp
git clone git://github.com/robbyrussell/oh-my-zsh.git /home/vagrant/.oh-my-zsh
@dakira
dakira / gist:134bbebd0298791d9e55
Last active Oct 25, 2019
unattended upgrade configuration
View gist:134bbebd0298791d9e55

needed packages: update-notifier-common unattended-upgrades

/etc/apt/apt.conf.d/10periodic

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";