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 UTF-8 to XML-safe HTML entities: Изложение => Изложение | |
*/ | |
function xmlencode($string) { | |
$string = (string) $string; | |
// Replace < and ' and & etc. | |
$string = htmlspecialchars($string, ENT_XML1 | ENT_QUOTES); |
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
javascript: (function(f, a) { | |
f = new Blob(['"Date","Description","Amount"\n', [].map.call(queryAllShadow('ing-ow-expandable-item', queryAllShadow('ing-feat-transaction-period').reverse()[0]), row => ([ | |
row.closest('.date-item').querySelector('time').getAttribute('datetime'), | |
row.querySelector('h5').textContent.trim(), | |
row.querySelector('h5 + strong').textContent.trim().replace(',', '.').replace('−', '-'), | |
]).map(col => '"' + col.replace(/"/g, '""') + '"').join(',')).join('\n')], {type: 'text/plain'}); | |
a = document.createElement('a'); | |
a.download = 'trans.csv'; | |
a.href = URL.createObjectURL(f); | |
a.click(); |
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 | |
$utcStart = microtime(true); | |
// Last modified timestamp | |
defined('TIMESTAMP') or define('TIMESTAMP', 'D d-M-Y H:i'); | |
// Permissions | |
defined('ENABLE_DOWNLOAD') or define('ENABLE_DOWNLOAD', false); | |
defined('ENABLE_SOURCE') or define('ENABLE_SOURCE', false); |
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 | |
class SendUserInvitationJob { | |
protected $user; | |
protected $tests; | |
function __construct(User $user, array $tests) { | |
$this->user = $user; | |
$this->tests = $tests; | |
} |
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
# all at once: | |
vendor/bin/behat | |
# per feature: | |
find features/ -type f -name *.feature | xargs -n 1 vendor/bin/behat |
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
-- SELECT | |
SELECT * | |
FROM orders O | |
WHERE 5 <= ANY(SELECT amount FROM order_lines WHERE order_id = O.id); | |
SELECT * | |
FROM orders O | |
WHERE id IN (SELECT order_id FROM order_lines WHERE amount >= 5); |
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
ClientController (page callback) | |
- Annotations | |
- @Get/@Post - URI | |
- @Middleware - auth | |
- AuthServiceProvider - auth definition | |
- UserPolicy - auth callbacks | |
User model (entity type) | |
- Shared logic | |
- Authenticable |
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
script=$1 | |
echo $script | |
while [ true ]; do | |
DT=$(date +"%Y%m%d_%H%M%S") | |
FILE="/tmp/keepalive-$DT.log" | |
echo $FILE | |
echo | |
touch $FILE |
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
// console.log(process.argv); | |
var port = parseInt(process.argv[2]); | |
if ( !port || isNaN(port) ) { | |
console.log('\nPort arg must be int.\n\n'); | |
process.exit(); | |
} | |
var status = [0, 0, 0, 0, 0, 0, 0, 0]; |
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 | |
// sendmail_path="C:\XAMPP\php\php.exe C:\WWW\mailtodisk.php \"C:\XAMPP\mailoutput\__TIME__-__RAND__-__SUBJECT__.eml\"" | |
// sendmail_path = "/usr/bin/php /var/www/mailtodisk.php \"/var/www/mailoutput/__TIME__-__RAND__-__SUBJECT__.eml\"" | |
// file_put_contents(__DIR__ . '/mailtodisk.log', print_r($_SERVER, 1)); | |
// Destination folder/filename is required | |
$destination = @$_SERVER['argv'][1]; | |
if (!$destination) { |