Skip to content

Instantly share code, notes, and snippets.

View ochui's full-sized avatar
🌏
Working from home and farm

Ochui, Princewill Patrick ochui

🌏
Working from home and farm
View GitHub Profile
@ochui
ochui / functions.php
Created September 29, 2020 06:08
Override Yoast SEO existing title or meta template variable
function filter_wpseo_replacements( $replacements ) {
if( isset( $replacements['%%currentmonth%%'] ) ){
$replacements['%%currentmonth%%'] = 'Sept';
}
return $replacements;
};
// Add filter
add_filter( 'wpseo_replacements', 'filter_wpseo_replacements', 10, 1 );
@ochui
ochui / AutoResponder.js
Created October 30, 2020 12:13 — forked from erronjason/AutoResponder.js
Gmail auto-responder for use in https://script.google.com
function AutoResponder(e) {
// Our email account that will be recieving:
var email_account = "[email protected]";
// Search for subject:
var subject = "testsubject";
// Send our response email
var threads = GmailApp.search("subject:(" + subject + ") label:unread to:(" + email_account + ")");
for (var i = 0; i < threads.length; i++) {
<?php
try {
$sSpreadsheetID = '16nfqj7V3Z4r2q4fHmiLXxmph5Ji-4Jw1BPGzYjTz3Kk';
$gclient = new \Google_Client();
$gclient->setApplicationName('Bluebot Google Sheets API PHP');
$gclient->setScopes(\Google_Service_Sheets::SPREADSHEETS);
$gclient->setAuthConfig(__DIR__.'/bluetext-adcce8c14228.json');
$gclient->setAccessType('offline');
$service = new \Google_Service_sheets($gclient);
<Response> <Dial> +13105555555 </Dial> </Response>
@ochui
ochui / unzip.php
Created June 23, 2021 20:49 — forked from ehnydeel/unzip.php
PHP-Unzip
<?php
// The unzip script
// This script lists all of the .zip files in a directory
// and allows you to select one to unzip. Unlike CPanel's file
// manager, it _will_ overwrite existing files.
//
// To use this script, FTP or paste this script into a file in the directory
// with the .zip you want to unzip. Then point your web browser at this
// script and choose which file to unzip.
<?php
function get_caller_id( $phone_number ) {
// Your Signalwire project id
$project_id = '';
// Your signalwire API Auth Token
$auth_token = '';
<?php
function get_linetype( $phone_number ) {
// Your Signalwire project id
$project_id = '';
// Your signalwire API Auth Token
$auth_token = '';
@ochui
ochui / watermark.js
Created November 18, 2021 18:56 — forked from suissa/watermark.js
Add watermark with Node.js and ffmpeg
var ffmpeg = require('ffmpeg');
try {
var process = new ffmpeg('example.mp4');
process.then(function (video) {
console.log('The video is ready to be processed');
var watermarkPath = 'watermark-suissa.png',
newFilepath = './video-com-watermark.mp4',
settings = {
position : "SE" // Position: NE NC NW SE SC SW C CE CW
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Thank you for calling YYZ co. Please leave a message.</Say>
</Response>
@ochui
ochui / ats.ino
Last active November 3, 2022 12:03
#include <PZEM004Tv30.h>
#include <SoftwareSerial.h>
#define MIN_TRIGGER_VOLTAGE = 120.0
#define DEBOUNCE = 10000
#define POWER_RELAY_1 = 2
#define POWER_RELAY_2 = 13
#define POWER_RELAY_TYPE = "ACTIVE_LOW" // ACTIVE_LOW or ACTIVE_HIGH