This file contains 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
/** | |
* Sends a email in both 'text/html' and 'plain/text'. | |
* | |
* @param string|array $to | |
* @param string $subject | |
* @param string $html | |
* @param string $text | |
* @return boolean|string | |
* @see stackoverflow.com/questions/22507176 | |
*/ |
This file contains 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
extension String { | |
func localizedWith(comment:String) -> String { | |
return NSLocalizedString(self, tableName: nil, bundle: Bundle.main, value: "", comment: comment) | |
} | |
} |
This file contains 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
--- | |
# Install Google Protocol Buffers as PECL extension | |
# https://github.com/google/protobuf/blob/master/php/README.md | |
# requires php-pear, php-dev and php7.2-fpm | |
- pear: | |
name: pecl/protobuf-3.5.1.1 | |
state: present | |
- name: Add protobuf extension to fpm and cli php.ini | |
lineinfile: |
This file contains 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
package com.github.gist.maxdw; | |
import java.text.CharacterIterator; | |
import java.text.StringCharacterIterator; | |
class Trim { | |
/** | |
* All characters on both the left side and the right side | |
* of the string that appear in the provided characters string | |
* argument will be trimmed until a character in string does |
This file contains 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 mysql-dump-file-splitter.php bigdump.sql | |
// outputs dump files in ./out/ | |
// php mysql-dump-file-splitter.php bigdump.sql dryrun | |
// does not output dump files but runs through the process | |
// options | |
define('OUTPUT_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'out' . DIRECTORY_SEPARATOR); | |
$memlimit = '96'/*MB*/ * 1024 * 1024; | |
$skiptables = explode(',', 'users'); // skips users table |