Update: There is a more secure version available. Details
<?php
$plaintext = 'My secret message 1234';| function getJSON(aUrl,sheetname) { | |
| //var sheetname = "test"; | |
| //var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
| var response = UrlFetchApp.fetch(aUrl); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // | |
| var data = dataAll.value.items; | |
| for (i in data){ | |
| data[i].pubDate = new Date(data[i].pubDate); | |
| data[i].start = data[i].pubDate; | |
| } |
| # How to use | |
| # Make sure you install curl. By running curl -v to test it. | |
| # Provide your Gmail username and password and who you need to send email to. | |
| # For password it is not your Gmail password but it is App passwords https://support.google.com/mail/answer/185833. Please go to your Gmail account setting and create it. | |
| # chmod -R 777 send-email-gmail.com | |
| # ./send-email-gmail.com | |
| # Your Gmail username (email) (Required) | |
| SENDER_GMAIL_USERNAME= | |
| # Your App password (Required) |
| # How to use | |
| # Make sure you install curl. By running curl -v to test it. | |
| # Provide your Gmail username and password and who you need to send email to. | |
| # For password it is not your Gmail password but it is App passwords https://support.google.com/mail/answer/185833. Please go to your Gmail account setting and create it. | |
| # chmod -R 777 send-email-gmail-thai.com | |
| # ./send-email-gmail-thai.com | |
| # Your Gmail username (email) (Required) | |
| SENDER_GMAIL_USERNAME= | |
| # Your App password (Required) |
| <?php | |
| class Lunar | |
| { | |
| const MIN_YEAR = 1891; | |
| const MAX_YEAR = 2100; | |
| const LUNAR_INFO = [ | |
| [0, 2, 9, 21936], [6, 1, 30, 9656], [0, 2, 17, 9584], [0, 2, 6, 21168], [5, 1, 26, 43344], [0, 2, 13, 59728], | |
| [0, 2, 2, 27296], [3, 1, 22, 44368], [0, 2, 10, 43856], [8, 1, 30, 19304], [0, 2, 19, 19168], [0, 2, 8, 42352], |
| $ docker service ps mysite | |
| ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR | |
| ad0lvaxnsbgcirz5botfle2k3 mysite.1 wordpress ubuntu-node01 Running Running 7 minutes ago | |
| 3w6vx7b5kbykgmnpl4n3xgz95 mysite.2 wordpress ubuntu-node02 Running Running less than a second ago | |
| btjrw6f33rud9vh6wa4pinzhj mysite.3 wordpress ubuntu-node03 Running Preparing 28 seconds ago | |
| ab1p9p075zvwlb3t1g5f1n8ww mysite.4 wordpress ubuntu-node04 Running Preparing 28 seconds ago |
Update: There is a more secure version available. Details
<?php
$plaintext = 'My secret message 1234';| <?php | |
| /** | |
| * simple method to encrypt or decrypt a plain text string | |
| * initialization vector(IV) has to be the same when encrypting and decrypting | |
| * | |
| * @param string $action: can be 'encrypt' or 'decrypt' | |
| * @param string $string: string to encrypt or decrypt | |
| * | |
| * @return string | |
| */ |
| <?php | |
| require_once 'vendor/autoload.php'; | |
| require_once 'container.php'; | |
| $app = Container::getInstance(); | |
| $app->bind('database', function($app) { | |
| $database = new Illuminate\Database\Capsule\Manager($app); |
| <?php | |
| namespace Jobs; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Redis\Database as Redis; | |
| class Foo extends Job | |
| { | |
| use InteractsWithQueue; |
| function asyncFunc(e) { | |
| return new Promise((resolve, reject) => { | |
| setTimeout(() => resolve(e), e * 1000); | |
| }); | |
| } | |
| const arr = [1, 2, 3]; | |
| let final = []; | |
| function workMyCollection(arr) { |