Skip to content

Instantly share code, notes, and snippets.

View derpixler's full-sized avatar

DerPixler derpixler

View GitHub Profile
@derpixler
derpixler / wp-create-admin-user-autologin.php
Last active December 15, 2023 12:02
WordPress mu-plugin: Automates the creation of an admin user in WordPress for development environments and do autologin this user
<?php
/*
Plugin Name: Automate admin user creation with autologin
Plugin URI: https://gist.github.com/derpixler/cf24cb3e858ecae4c11b44f5edfb212d
Description: Automates the creation of an admin user in WordPress for development environments and do autologin this user. Dirk Diggler is a fictional character from the movie "Boogie Nights," loosely based on the life of real-life porn star John Holmes. Dirk, portrayed as a young man with immense talent in the adult film industry, goes on a journey through the highs and lows of fame.
Version: 1.0.0
Author: René Reimann
Author URI: https://rene-reimann.de
*/
//--- Preparation ----
let wrapperNode = document.createElement('div');
let posibleGroupeKeys = ['fooo','barrrr','foo','bar'];
for (let i = 0; i < 129; i++) {
let childNode = document.createElement('span');
childNode.dataset.collectionGroup = posibleGroupeKeys[Math.floor(Math.random(0,posibleGroupeKeys.length)*posibleGroupeKeys.length)];
wrapperNode.append(childNode);
}
@derpixler
derpixler / docker-killer.txt
Created February 24, 2020 07:20
Docker Killer
stop all containers:
docker kill $(docker ps -q)
remove all containers
docker rm $(docker ps -a -q)
remove all docker images
docker rmi $(docker images -q)
@derpixler
derpixler / docker-compose.yml
Created February 7, 2020 14:12
Nginx Proxy for docker
version: "3.1"
services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./certs:/etc/nginx/certs
- /var/run/docker.sock:/tmp/docker.sock:ro
let ScrollNavi = require('../base_scrollNavi');
let mouseEventMock = {
preventDefault: () => {},
stopPropagation: () => {}
};
window.scrollBy = jest.fn();
@derpixler
derpixler / awsmAdditionalStyle.js
Last active April 16, 2019 06:54
CloneNodes and add clonedElements
var awsmAdditionalStyle = function (additionals = []) {
this.listElem = document.querySelector('.awsm-preset-list');
this.additionals = additionals ? additionals : [];
if(this.listElem && this.additionals) {
this.input = this.listElem.querySelector('input');
this.label = this.listElem.querySelector('label');
var cloneInput = function (additionals) {
if (!this.input) {
{
"name": "@derpixler/jest-prototype-tests",
"version": "1.0.0",
"description": "",
"main": "the-prototype.js",
"scripts": {
"test": "jest"
},
"jest": {
"verbose": true,
{
"de": {
"longTerm": "germany",
"isoAlpha2": "de",
"isoAlpha3": "deu"
},
"at": {
"longTerm": "austria",
"isoAlpha2": "at",
"isoAlpha3": "aut"
@derpixler
derpixler / PHPstorm-live-template.php
Last active February 17, 2017 08:12
PHPstorm better DebugSnipped
/**
* 1. Goto Preferences -> Editor -> Live Template -> PHP
* 2. Klick in the right +
* 3. chose Live Template
* 4. Give a abbreviation like "pdebug"
* 5. Copie the Template into Template Text
* 6. in your code Type "pdeb.." use auto compleate ;)
*
* You get a Debug like this.
*