Skip to content

Instantly share code, notes, and snippets.

View dsturm's full-sized avatar

Daniel Sturm dsturm

View GitHub Profile
@dsturm
dsturm / Localizable.strings
Last active June 26, 2023 14:58
German translation for PHPMon
/*
Strings.strings
PHP Monitor
Created by Nico Verbruggen on 16/05/2020.
Copyright © 2023 Nico Verbruggen. All rights reserved.
*/
// MENU ITEMS (MI)
@dsturm
dsturm / functions.php
Created March 10, 2023 10:09 — forked from tripflex/functions.php
Programmatically create a WooCommerce Subscription and associated WooCommerce Order
<?php
public function give_user_subscription( $product, $user_id, $note = '' ){
// First make sure all required functions and classes exist
if( ! function_exists( 'wc_create_order' ) || ! function_exists( 'wcs_create_subscription' ) || ! class_exists( 'WC_Subscriptions_Product' ) ){
return false;
}
$order = wc_create_order( array( 'customer_id' => $user_id ) );
@dsturm
dsturm / Create.php
Last active November 5, 2021 15:06
Filament - User create
<?php
namespace App\Http\Livewire\Users;
use App\Models\User;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Livewire\Component;
@dsturm
dsturm / fix-gform-in-popups.js
Last active September 27, 2021 12:56
Elementor
(function ($) {
$(document).on("elementor/popup/show", function (event, popupId, popup) {
var gformWrapper = $(".gform_wrapper", popup.$element);
if (!gformWrapper.length) {
return;
}
var gformId = ("" + gformWrapper.first().attr("id")).replace(
/^gform_wrapper_/,
""
);
@dsturm
dsturm / composer.md
Last active September 1, 2021 08:08
Shopware workflow

Shopware setup

Config

composer config sort-packages true

composer config repositories.shopware composer https://packages.shopware.com
composer config bearer.packages.shopware.com {{KEY}}
@dsturm
dsturm / DKIM_SPF_Sendmail
Created March 11, 2019 08:59 — forked from artmouse/DKIM_SPF_Sendmail
DKIM + SPF + Sendmail for multiple domains (Ubuntu)
DKIM is DomainKeys Identified Mail and is used in mail servers, such as Postfix or Sendmail to sign e-mails and thus authenticating the sender so that a forgery can be detected. It also reduces the possibility of an e-mail being flagged as spam, but it's not a definite prevention.
A much simpler method is using SPF (Sender Policy Framework) which, in a nutshell, verifies the sender IP address.
According to the internet, using both should result to ????, PROFIT !!!.
SPF does not need a specific configuration. Whitelisted servers are listed in a DNS record, TXT or SPF, and an example record is:
example.com. IN TXT "v=spf1 a mx ~all"
@dsturm
dsturm / tastillery.css
Last active November 21, 2017 14:17
Tastillery
.template-page-club .section-header.club-page-header {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding: 50px 55px;
}
.template-page-club .section-header-grid-item {
@dsturm
dsturm / index.html
Created November 20, 2017 14:21
Vue Datetime Picker Component // source http://jsbin.com/yurexon
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue Datetime Picker Component</title>
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css"/>
<style type="text/css">
body {
margin: 5em;
@dsturm
dsturm / target_blank.js
Last active October 26, 2017 15:15 — forked from allybee/target_blank.js
Add target="_blank" to external links with pure JavaScript.
function targetBlank() {
// remove subdomain of current site's url and setup regex
var internal = location.host.replace(/^[^.]+\./g, '');
internal = new RegExp(internal, "i");
var a = document.getElementsByTagName('a'); // then, grab every link on the page
for (var i = 0; i < a.length; i++) {
var href = a[i].host; // set the host of each link
if (!internal.test(href)) {
// make sure the href doesn't contain current site's host
@dsturm
dsturm / countdown_expr.js
Last active May 4, 2017 12:56
Adobe AfterEffects
/**
* Expression for displaying up- or countdowns
* @credits to https://forums.adobe.com/thread/2191716
*/
rate = 1;
direction = 'down';
type = 'full';
clockStart = 0;