This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Needed software: | |
| - HFS HTTP fileserver (for serving firmware file) - https://www.rejetto.com/hfs/?f=dl | |
| - Not all HTTP servers will work, it has to support streaming, I think | |
| - Postman (for instructing device to download file from URL) - https://www.postman.com/downloads/ | |
| - OTA protocol documentation: https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v2.0%20Doc.pdf | |
| Steps: | |
| - Prepare your firmware you want to flash (for example from ESPHome) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- delete any usermeta specific to the other subsites | |
| delete from wp_usermeta where meta_key regexp '^wp_([0-9]+)_'; | |
| -- duplicate the wp_usermeta structure in a working data table, | |
| -- but add a unique index for filtering out duplicates | |
| create table _fix_usermeta like wp_usermeta; | |
| alter table _fix_usermeta add unique(user_id, meta_key); | |
| -- copy the site-specific usermeta, keeping only the last of each duplicate | |
| insert into _fix_usermeta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -u | |
| # To the extent possible under law, Viktor Szakats (vsz.me) | |
| # has waived all copyright and related or neighboring rights to this | |
| # script. | |
| # CC0 - https://creativecommons.org/publicdomain/zero/1.0/ | |
| # Upload a file to Amazon AWS S3 using Signature Version 4 | |
| # | |
| # docs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Set the following constants in wp-config.php. | |
| * These should be added somewhere BEFORE the constant ABSPATH is defined. | |
| * | |
| * Author: Chad Butler | |
| * Author URI: https://butlerblog.com | |
| * | |
| * For more information and instructions, see: https://b.utler.co/Y3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('comment_notification_recipients', 'override_comment_notice_repicient', 10, 2); | |
| function override_comment_notice_repicient($emails, $comment_id) { | |
| $comment = get_comment( $comment_id ); | |
| if ( empty( $comment ) ) | |
| return $emails; | |
| $post = get_post( $comment->comment_post_ID ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # EditorConfig helps keep your project formatting consistent. | |
| # See https://EditorConfig.org | |
| # | |
| # This is a modified version of the WordPress coding standards. | |
| # | |
| # Author: Sal Ferrarello (@salcode) | |
| # https://salferrarello.com/wordpress-editorconfig/ | |
| # | |
| # You can download this file directly | |
| # to your project from the command-line with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" | |
| content="text/html; charset=utf-8" /> | |
| <script src="jquery-1.7.2.min.js" ></script> | |
| <script src="handlebars-1.0.0.beta.6.js" ></script> | |
| <script src="underscore-min.js" ></script> | |
| <script src="backbone-min.js" ></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Usage for a custom post type named 'movies': | |
| * unregister_post_type( 'movies' ); | |
| * | |
| * Usage for the built in 'post' post type: | |
| * unregister_post_type( 'post', 'edit.php' ); | |
| */ | |
| function unregister_post_type( $post_type, $slug = '' ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pullJSON() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheets = ss.getSheets(); | |
| var sheet = ss.getActiveSheet(); | |
| var url="http://example.com/feeds?type=json"; // Paste your JSON URL here | |
| var response = UrlFetchApp.fetch(url); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // |