Skip to content

Instantly share code, notes, and snippets.

View designrubenz's full-sized avatar

Johannes Rubenz designrubenz

View GitHub Profile

Elm Workshop

Agenda

Introduction

Setup

Scraping on the go

stories = []

$('a[id*="story"]').each(function(index, item) {stories.push(item.textContent)});

copy(stories);

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@designrubenz
designrubenz / php-brew.md
Last active March 6, 2018 20:01
multiple PHP versions with homebrew

multiple PHP versions with homebrew

brew switch php70 7.0.15_8

unlink previous version, eg. brew unlink php56

Currently can't use 7.2 as it responds way too slowly.

@designrubenz
designrubenz / apache.md
Last active November 10, 2021 22:35
Apache MacOS
@designrubenz
designrubenz / functions.php
Last active November 25, 2020 07:51
Wordpress: reduce to the max
<?php
function wp_customize_admin_menu() {
remove_menu_page( 'edit.php' );
remove_menu_page( 'edit-comments.php' );
remove_submenu_page( 'themes.php', 'theme-editor.php' );
remove_submenu_page( 'plugins.php', 'plugin-editor.php' );
remove_submenu_page( 'tools.php', 'tools.php' );
remove_submenu_page( 'tools.php', 'import.php' );
remove_submenu_page( 'options-general.php', 'options-discussion.php' );

Systeminitialisierung in macOS

Nach dem Start des Kernels (PID 0: kernel_task) wird als Erstes der launchdaemon launchd (PID: 1) gestartet. Dieser lädt und verwaltet alle Hintergrundprozesse:

"Many kinds of tasks that do not require user interaction are most effectively handled by a process that runs in the background. You can use a daemon or service to:

@designrubenz
designrubenz / README.md
Last active September 30, 2021 23:14
Neuen SSH-Key auf Hetzner-Server hinterlegen
  1. neues SSH keypair generieren (s. github-Doku )
  2. Dann in der robot-Oberfläche:
  • rescue-System aktivieren (Passwort notieren)
  • Server restart
  • auf Server per SSH/rescue-Passwort zugreifen
  • Server-Partition mounten! (sonst befindet man sich nur auf der Partition des Rescue-Systems) (s. hetzner-Doku )
  • neue Keys hinterlegen (z.B. in /root/.ssh/authorized_keys)
  • Server restart
@designrubenz
designrubenz / README.md
Created July 26, 2018 14:54
mySQL 8 / PHP: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root