Skip to content

Instantly share code, notes, and snippets.

View johanoloflindberg's full-sized avatar
💭
Ready to work 😃

WEBBAB johanoloflindberg

💭
Ready to work 😃
View GitHub Profile
@nobodyguy
nobodyguy / printer_monitor.js
Last active August 14, 2024 02:04
Shelly Plus Plug S script to automatically turn off the plug after 3D printing has finished and cooling delay has elapsed
// This script detects printing start and stop events based on power consumption.
// When the stop event is detected, it waits for 15 minutes to enable printer to cool down and shutdown event is triggered.
let CONFIG = {
cooldownDelay: 15 * 60 * 1000, // 15 minutes
idlePowerMax: 12, // 12 Watts (in reality 7-8W)
};
let cooldownTimer = null;
let printingStarted = false;
@kawainime
kawainime / awesome-ai-tools.md
Last active April 2, 2025 07:21
awesome-ai-tools
@hedqvist
hedqvist / functions.php
Created March 26, 2020 10:23
Fortnox - Dont sync customers
<?php
/**
* @snippet WooCommerce - Fortnox - Dont sync customers, ever
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.8.0
*/
add_filter( 'obj_fortnox_sync_guest_user', '__return_false' );
add_filter( 'obj_fortnox_sync_user', '__return_false' );
@hedqvist
hedqvist / functions.php
Last active April 9, 2023 13:11
Fortnox - Personnummer
<?php
/**
* @snippet WooCommerce - Fortnox plugin by Redlight Media - Add custom field to Fortnox via functions.php
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.5.2
*/
function redlight_fortnox_pnr_guest_customer( $customer, $order_id ) {
$organisationsnummer = get_post_meta($order_id, 'organisationsnummer', true);
if(!empty($organisationsnummer)){
@johanoloflindberg
johanoloflindberg / gist:948b8601482167e848fe38d668882f97
Created February 25, 2020 16:54
Webbproduktion av Webbyrån WEBBAB - Webbyrån WEBBAB i Gävle producerade denna webbplats
<div class="textwidget"><small class="byline"><a href="http://webbab.se" target="_blank" title="Webbyrån WEBBAB i Gävle producerade denna webbplats">Webbproduktion av <br>Webbyrån WEBBAB</a></small><br></div>
@hedqvist
hedqvist / functions.php
Last active December 10, 2024 12:52
Fortnox - Set Email Address to billing email
<?php
/**
* @snippet WooCommerce -Fortnox - Set customers email to Order billing emailing
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.9.0
*/
function redlight_fortnox_order_email_to( $orderData, $order_id) {
$order = wc_get_order($order_id);
$orderData['Order']['EmailInformation']['EmailAddressTo'] = $order->get_billing_email();
@SpiderMate
SpiderMate / RouterDefaultPasswords.txt
Last active January 15, 2020 16:20
Default Router Passwords Collection
TESTED ROUTER DEFAULT PASSWORDS: @SpiderSec
----------------------------------------------------------------------------------------
Digisol : user=admin,pass=1234 (Tested on DG-HR3400)
D-Link : user=Admin,pass=blank (Tested on DIR-615)
TP-Link : user=admin,pass=admin (Tested on WR720N 2.0)
Ubiquiti : user=ubnt,pass=ubnt (Tested on EdgeRouter 12 (ER-12))
Tenda : user=admin,pass=admin (Tested on Tenda N301 )
Mercusys : user=admin,pass=admin (Tested on Mercury MW305R )
iBall : user=admin,pass=admin (Tested on iB-WRB333N )
Netis : user=guest,pass=guest (Tested on Netis WF2411 )
@hedqvist
hedqvist / functions.php
Created December 2, 2019 17:01
Fortnox - Customer Type
<?php
/**
* @snippet WooCommerce - Fortnox plugin by Redlight Media - (REGISTRED USERS) Set customer Type to Private
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.8.0
*/
function redlight_custom_customer_type( $customer) {
$customer['Customer']['Type'] = 'PRIVATE';
@hedqvist
hedqvist / functions.php
Last active October 5, 2023 07:56
Fortnox - Set custom ordernumber, add this to "YourOrderNumber" in Fortnox
<?php
/**
* @snippet WooCommerce -Fortnox - Set # infront of ordernumber, add this to "YourOrderNumber" in Fortnox
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 8.0.2
*/
function redlight_fortnox_order_ordernumber_prefix( $orderData, $order_id) {
$order = wc_get_order($order_id);
$orderData['Order']['YourOrderNumber'] = $order->get_meta('_custom_order_number', true);
@hedqvist
hedqvist / functions.php
Created November 25, 2019 14:50
Fortnox - Set PhoneNumber to both Phone1 and Phone2 fields in Fortnox
<?php
/**
* @snippet WooCommerce -Fortnox - Set PhoneNumber to Phone2 field in Fortnox
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.8.0
*/
function redlight_fortnox_order_both_phone_fields( $orderData, $order_id) {
$order = new WC_Order($order_id);
$orderData['Order']['Phone2'] = $order->get_billing_phone();