This collection on standards by HQHow.com
- Escape, echo, sanitize,...validate input data
- Every echo must include text-domain for the translation
- If there's empty file, delete it
- If there's the commented code, delete it on the production commit.
- If you want to regist the resources file, like CSS or JS, you must pay attention to the - performance and how it will affect to user's site
- For every output class name, they must have the plugin prefix, i.e InnoRef, the prefix should be inr-your-class-name
- Try not to override the basic elements like a, b, strong, i....you will want to mantain the consistancy of the UI through out the website
- If you want to call and run AJAX, you just do it via wp-ajax.php action, and must pay attention to logged in/out user case.
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
| #!/usr/bin/env python | |
| """ | |
| Git commit hook: | |
| .git/hooks/commit-msg | |
| Check commit message according to guidelines | |
| """ | |
| import sys | |
| import re |
You can use this script to bypass the bans on Telegram API by different hosts. Simply send the request to this script instead of the Telegram Bot API after deploying it as a web app and allowing anonymous access.
It accepts bot GET and POST requests with the following params
| name | type | Description |
|---|
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
| # Converts a JSONL file generated with telegram-history-dump (1) to CSV | |
| # Usage: python telegram-csv.py <path to json file> <path to output csv file> | |
| # Example: python telegram-csv.py Bob.json Bob.csv | |
| # 1: https://github.com/tvdstaaij/telegram-history-dump | |
| from datetime import datetime | |
| import unicodecsv as csv | |
| import json, sys | |
| def get_isodate(msg): | |
| date = msg.get("date", None) |
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 | |
| // 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 |
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
| user web; | |
| # One worker process per CPU core. | |
| worker_processes 8; | |
| # Also set | |
| # /etc/security/limits.conf | |
| # web soft nofile 65535 | |
| # web hard nofile 65535 | |
| # /etc/default/nginx |
This workaround install is necessary because PDFtk was pulled from homebrew-cask due to issues with it aggressively overwriting file permissions that could impact other installed libraries. See this homebrew-cask issue.
The following steps worked on Mac OS X 10.10.1 with a standard brew installation for the PDFtk Mac OS X server libary version 2.02.
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 | |
| /** | |
| * Insert an attachment from a URL address. | |
| * | |
| * @param string $url The URL address. | |
| * @param int|null $parent_post_id The parent post ID (Optional). | |
| * @return int|false The attachment ID on success. False on failure. | |
| */ | |
| function wp_insert_attachment_from_url( $url, $parent_post_id = null ) { |
By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk.
This process is outlined at the Nginx ngx_http_fastcgi_module page manual page.
NewerOlder