Skip to content

Instantly share code, notes, and snippets.

View EmileBons's full-sized avatar

Emile Bons EmileBons

View GitHub Profile
@EmileBons
EmileBons / snap7-get-date-time.py
Last active June 22, 2021 15:41
Snap7-based example of retrieving the date and time from a DTL-field, DATE-field, or TOD-field (time of day). Tested on a Siemens 1214C PLC.
import datetime
import snap7
from snap7.util import *
class DtlExample:
def __init__(self, ip, db):
self.plc = snap7.client.Client()
self.ip = ip
self.db = db
@EmileBons
EmileBons / eu-countries.php
Created March 12, 2018 09:32
A list of the countries in the European Union with their ISO 3166-1 (alpha 2) country code as the key and the English country name as the value.
$euCountries = array(
'AT' => 'Austria',
'BE' => 'Belgium',
'BG' => 'Bulgaria',
'HR' => 'Croatia',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'EE' => 'Estonia',
'FI' => 'Finland',

Keybase proof

I hereby claim:

  • I am emilebons on github.
  • I am emilebons (https://keybase.io/emilebons) on keybase.
  • I have a public key ASBrvnqyjzUD31mb9vJ6LGRHRB9OgoadrZxfx9Y3R9i7Tgo

To claim this, I am signing this object:

@EmileBons
EmileBons / modified-wordpress-index.php
Last active March 15, 2016 15:27
Modified Wordpress index.php to sanitize crap like empty lines caused by shitty plugins.
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.