Skip to content

Instantly share code, notes, and snippets.

View tbreuss's full-sized avatar
🚴‍♂️
Biking

tebe tbreuss

🚴‍♂️
Biking
View GitHub Profile
@tbreuss
tbreuss / is_natural.php
Created April 10, 2014 19:15
A simple function to recognize whether the value is a natural number.
<?php
function is_natural($val, $acceptzero = false)
{
$return = ((string) $val === (string) (int) $val);
if ($acceptzero) {
$base = 0;
} else {
$base = 1;
}
@tbreuss
tbreuss / SymfonyEventDispatcherExample.php
Created August 25, 2014 15:57
A very simple example using the Symfony EventDispatcher component.
<?php
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class MyListener
{
public function onFooAction(Event $event)
@tbreuss
tbreuss / procEnableKeysOnAllTables.sql
Last active February 23, 2016 10:44
This is a stored procedure that loops through all tables of a database and enables indexes
DELIMITER $$
DROP PROCEDURE IF EXISTS procEnableKeysOnAllTables $$
CREATE PROCEDURE procEnableKeysOnAllTables()
BEGIN
DECLARE table_name VARCHAR(255);
DECLARE end_of_tables INT DEFAULT 0;
@tbreuss
tbreuss / linux-kommandos.md
Last active March 24, 2016 16:46
LINUX - Kommandos

LINUX - Kommandos

Befehl Beschreibung Art
at Ausführen eines Programms Scheduler
atq Anzeigen der einmalig geplanten Programmen Scheduler
atrm Löschen eines einmalig geplanten Programms Scheduler
batch Ausführen eines Programms bei niedriger Systemlast Scheduler
cal Kalender anzeigen
cat Verknüpfung von Dateien ("concatenate") Allgemein
@tbreuss
tbreuss / regex-multiline-colon-separated-key-value-pairs.php
Last active April 5, 2016 13:07
Regex to capture colon-separated key-value pairs, with multi-line values
<?php
$contents = "
@title: Tests / Variablen
@menu: Variablen
@layout: default.html
@format: md
@twig: 1
@date: 1388102400
@keep_extension: 0
@tbreuss
tbreuss / markdown.css
Created May 23, 2016 08:13
Default styling for Markdown files.
body{
margin: 0 auto;
font-family: Georgia, Palatino, serif;
color: #444444;
line-height: 1;
max-width: 960px;
padding: 30px;
}
h1, h2, h3, h4 {
color: #111111;
@tbreuss
tbreuss / dnsbl.php
Last active December 21, 2023 20:29
IP Blacklist Check Script - This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.
<?php // Simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once. ?>
<html>
<head>
<title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
</head>
<body>
<h2>IP Blacklist Check Script</h2>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" value="" name="ip"/>
<input type="submit" value="LOOKUP"/>
@tbreuss
tbreuss / .bash_profile
Last active June 17, 2017 07:10 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@tbreuss
tbreuss / zabbix-installation.md
Last active May 25, 2017 07:00
Zabbix Installations-Anleitung

Zabbix Installationsanleitung

Diese Anleitung orientiert sich im wesentlichen an http://c64-online.com/?page_id=4707. Sie unterscheidet sich aber in der eingesetzten Zabbix Version (LTS-Version 3.0.8) und der Server Infrastruktur (Raspberry Pi 3).

Zabbix Server installieren

Das Raspbian Betriebssystem aktualisieren:

@tbreuss
tbreuss / Application.php
Created June 30, 2017 09:00 — forked from shameerc/Application.php
Simple plugin system using Reflection api
<?php
/**
* Application class
*
* @author Shameer
*/
class Application {
private $plugins = array();
public function __construct() {
// Constructor