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 | |
| /* | |
| Plugin Name: SearchWP Remove Arabic Diacritics | |
| Description: Removes all kind of إعراب-signs as well as تشكيل-signs for the use of SearchWP Wordpress plugin. | |
| Author: Gerald Drissner | |
| Note: This is a fork and extension of https://gist.github.com/BrElio/bd84d8035278adf834b29ec5e1187567 and Relevannsi's code snippet regarding foreign languages. | |
| Version: 1.0.0 | |
| Last update: 2022-10-20 | |
| */ |
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
| import gitlab | |
| import urllib3 | |
| import humanfriendly | |
| import timeago, datetime | |
| # 2020-04-24T12:04:26.475+00:00 | |
| date_now = datetime.datetime.now() | |
| urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) |
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
| @import "compass/css3/images"; | |
| // CSS-only multi-line ellipsis with generated content | |
| // yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin | |
| @mixin limitLines( | |
| $maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action. | |
| $maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation. | |
| // Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape, | |
| // the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query). |
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(m){ | |
| /* | |
| * PHP => moment.js | |
| * | |
| * http://www.php.net/manual/en/function.date.php | |
| * http://momentjs.com/docs/#/displaying/format/ | |
| */ | |
| var formatMap = { | |
| d: 'DD', | |
| D: 'ddd', |
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 | |
| function wp_log_http_requests( $response, $args, $url ) { | |
| // set your log file location here | |
| $logfile = plugin_dir_path( __FILE__ ) . '/http_requests.log'; | |
| // parse request and response body to a hash for human readable log output | |
| $log_response = $response; | |
| if ( isset( $args['body'] ) ) { |
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/bash | |
| # Export some ENV variables so you don’t have to type anything | |
| export AWS_ACCESS_KEY_ID='my-key-id' | |
| export AWS_SECRET_ACCESS_KEY='my-secret' | |
| export PASSPHRASE='my-gpg-key-passphrase' | |
| GPG_KEY='my-gpg-pub-id' | |
| # The source of your backup | |
| SOURCE=/ |
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 countCSSRules() { | |
| var results = '', | |
| log = ''; | |
| if (!document.styleSheets) { | |
| return; | |
| } | |
| for (var i = 0; i < document.styleSheets.length; i++) { | |
| countSheet(document.styleSheets[i]); | |
| } | |
| function countSheet(sheet) { |
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 | |
| /* | |
| * Converts CSV to JSON | |
| * Example uses Google Spreadsheet CSV feed | |
| * csvToArray function I think I found on php.net | |
| */ | |
| header('Content-type: application/json'); | |
| // Set your CSV feed |