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
email_file=$(tempfile) | |
# Compose message | |
echo "From: Earthlings <[email protected]>" >> $email_file | |
echo "To: Martians <[email protected]>" >> $email_file | |
echo "Subject: Helloooo world" >> $email_file | |
echo "Content-Type: text/plain; charset=\"utf8\"" >> $email_file | |
echo >> $email_file | |
echo "Hi! :)" >> $email_file | |
# Send the email |
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 | |
MYSQL_BIN_LOG_FOLDER='/var/lib/mysql' | |
MYSQL_BIN_LOG_FORMAT='.*mysql\-bin.*' | |
DATABASE_NAME=$1 | |
START_TIMESTAMP=$2 | |
END_TIMESTAMP=$3 | |
echo $DATABASE_NAME | |
echo $START_TIMESTAMP |
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 | |
$requestedPath = '...'; | |
$service = $app['service.filesystem']; | |
$fullFilePath = realpath($requestedPath); | |
// If the file path cannot be found then stop proceeding | |
if(!$fullFilePath) die('INVALID'); | |
$fileStat = stat($fullFilePath); | |
$finalAllowedTimeStamp = strtotime("2017-02-01"); |
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
{% extends "@app/form_layout.html.twig" %} | |
{% block _{FORM_NAME}_{ELEMENT_NAME}_widget %} | |
{{ form_widget(form) }} Modified | |
{% endblock %} |
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 | |
echo <<<EOT | |
One month ago was ${!${''} = date('Y-m-d H:i:s', strtotime('-1 month'))}. | |
EOT; |
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 | |
/** | |
* throw exceptions based on E_* error types | |
*/ | |
set_error_handler(function ($err_severity, $err_msg, $err_file, $err_line, array $err_context) | |
{ | |
// error was suppressed with the @-operator | |
if (0 === error_reporting()) { return false;} | |
switch($err_severity) | |
{ |
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/expect -c 'spawn openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./apache.key -out ./apache.crt | |
expect -re {Country Name \(2 letter code\) [^:]*:} {send "NP\n"} | |
expect -re {State or Province Name \(full name\) [^:]*:} {send "Bagmati\n"} | |
expect -re {Locality Name \(eg, city\) [^:]*:} {send "Budhanilkantha\n"} | |
expect -re {Organization Name \(eg, company\) [^:]*:} {send "nGen Technologies\n"} | |
expect -re {Organizational Unit Name \(eg, section\) [^:]*:} {send "Software Development\n"} | |
expect -re {Common Name \(e.g. server FQDN or YOUR name\) [^:]*:} {send "mrnepal.com\n"} | |
expect -re {Email Address [^:]*:} {send "[email protected]\n"} | |
expect eof' |
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($) { | |
$(function() { | |
var isoCountries = [ | |
{ id: 'AF', text: 'Afghanistan'}, | |
{ id: 'AX', text: 'Aland Islands'}, | |
{ id: 'AL', text: 'Albania'}, | |
{ id: 'DZ', text: 'Algeria'}, | |
{ id: 'AS', text: 'American Samoa'}, | |
{ id: 'AD', text: 'Andorra'}, | |
{ id: 'AO', text: 'Angola'}, |