Skip to content

Instantly share code, notes, and snippets.

View ocReaper's full-sized avatar

Ákos Resch ocReaper

View GitHub Profile
@milbar
milbar / _init.py
Created June 19, 2024 14:57
BroadLink Thermostat Schedule Setup
import broadlink
import time
from typing import List
def discover_devices():
devices = broadlink.discover(timeout=5, local_ip_address='')
if devices:
for device in devices:
device.auth()
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active June 21, 2024 11:36
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@collegeman
collegeman / Handler.php
Last active September 5, 2022 06:59
Boilerplated files for Lumen-based WordPress plugins
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active May 27, 2024 17:37
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@RadGH
RadGH / rs_upload_from_path.php
Last active November 2, 2023 17:52
Upload a local file as a WordPress attachment, placing it in the Media library. Supports images, PDFs, and other file types.
<?php
/**
* This function uploads from a local file path.
* To upload from a URL instead
* @see: https://gist.github.com/RadGH/966f8c756c5e142a5f489e86e751eacb
*
* Example usage: Upload photo from file, display the attachment as as html <img>
* $attachment_id = rs_upload_from_path( "/images/photo.png" );
* echo wp_get_attachment_image( $attachment_id, 'large' );
@macbleser
macbleser / wp-permissions-script
Created February 21, 2014 15:37
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory