Skip to content

Instantly share code, notes, and snippets.

View Werninator's full-sized avatar
👀

Patrick Werner Werninator

👀
  • Germany
View GitHub Profile
@Werninator
Werninator / dsgvo.txt
Last active August 7, 2018 13:23
WP contactform 7 DSGVO Acceptance checkbox
[acceptance dsgvo] Ich habe die <a href="/blog.php/datenschutz/" target="_blank">Datenschutzerklärung</a> gelesen und akzeptiert*
[acceptance dsgvo] I have read and accepted the <a href="/blog.php/datenschutz/" target="_blank">data security declaration</a>*
[acceptance dsgvo] J'ai lu et accepté la <a href="/blog.php/datenschutz/" target="_blank">politique de confidentialité</a>*
[acceptance dsgvo] Ho letto e accettato <a href="/blog.php/datenschutz/" target="_blank">l'informativa sulla privacy</a>*
@Werninator
Werninator / recursive_grep.txt
Last active June 28, 2018 08:16
unix: search for string recursively
grep -rnw . -e 'waldo'
find . -name 'waldo.txt'
@Werninator
Werninator / compare.php
Created April 11, 2018 10:01
Compare two files in PHP
<?php
/**
* Compare the contents of two files and return if they're the same
*
* modified version of:
* https://jonlabelle.com/snippets/view/php/quickly-check-if-two-files-are-identical
*
* @param string $fileOne path to file One
* @param string $fileTwo path to file two
@Werninator
Werninator / functions.php
Created April 4, 2018 13:48
WooCommerce Germanized: Add String before Item / Product Title in PDF
<?php
// add this snippet to your functions.php if you want this kind of funcitonality
function add_something_before_invoice_item_name($name, $item) {
// getting category terms
$terms = get_the_terms($item->get_product_id(), 'product_cat');
// if this product has the category "Premium", it will be prepended to the name
foreach ($terms as $term)
@Werninator
Werninator / 01_readme.md
Created March 12, 2018 10:15
How to get 'WooCommerce Dynamic Pricing' values / rules programmatically

How to get 'WooCommerce Dynamic Pricing' values / rules programmatically

After searching a bit (and not finding anything about it), here's a little documentation on how to get your pricing rules of the WooCommerce Dynamic Pricing Plugin programmatically.

@Werninator
Werninator / system.xml
Created October 27, 2017 09:54
(Magento 1.9.x) access file upload from the settings
<!--
Warning: simplified, check out
https://www.kathirvel.com/adding-file-uploads-to-magento-admin-system-configuration/
-->
<config>
<sections>
<TAB_NAME>
<groups>
<GROUP_NAME>
<fields>
@Werninator
Werninator / onion-boy.md
Last active September 26, 2017 15:02
SPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMP

onion boy

a game about onion boy

general idea

onion boy is an onion with arms and legs with a huge nose

his goal is to find eyes so he can happily cry because of himself

@Werninator
Werninator / auf.JPEG.exe.md
Last active February 18, 2022 22:23
SPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMPSPOOKYFISTPUMP

auf

a game about elevators

moved to https://github.com/Werninator/auf

general idea

in auf you control elevator(s) to bring different people from one floor to another

@Werninator
Werninator / resize-window.gd
Last active August 22, 2017 18:02
Godot: centers the game window
# https://godotengine.org/qa/485/how-to-center-game-window
var screen_size = OS.get_screen_size()
var window_size = OS.get_window_size()
func _ready():
OS.set_window_position(screen_size * .5 - window_size * .5)
@Werninator
Werninator / embed.html
Created July 4, 2017 13:52
embedding pdfs
<!-- Contents can't be accessed (might be good for pdf stuff) -->
<object data="abc.pdf" type="application/pdf">
<!-- Alternative content when Object can't be loaded (coz of older browsers): HTML5 <embed>, contents can be manipulated -->
<embed src="abc.pdf" type="application/pdf" />
</object>