http://www.mustbebuilt.co.uk/php/php-and-json-json_encode-and-json_decode/
Thursday, February 21, 2019
Saturday, October 13, 2018
xcode programming resources
The Swift 4 Programming Language Guide from Apple
Section 8, Lecture 77
Swift Programming Language Guide
You can download The Swift Programming Language Guide from Apple for free here:
Read in iBooks:
StackOverflow
Apple Developer Forum
https://forums.developer.apple.com/Apple API Reference
Apple Guides and Sample Code
Friday, October 12, 2018
Saturday, October 6, 2018
PHP: SSH to Remote Server
Install phpseclib into the specified location :
# cd /path/to/install/phpseclib
# composer require phpseclib/phpseclib
or
# composer require phpseclib/phpseclib:~2.0
http://phpseclib.sourceforge.net/ssh/2.0/examples.html
<?php
require __DIR__ . '/../vendor/autoload.php';
use phpseclib\Net\SSH2;
use phpseclib\Crypt\RSA;
$ssh = new SSH2('web.goweekend.ca');
$key = new RSA();
$key->loadKey(file_get_contents('/home/apache/.ssh/id_rsa'));
if (!$ssh->login('dboard', $key)) {
exit('Login Failed');
}
$deploymentScript = 'sudo /autoDeployment/deployApplication.sh uat install ETFTrade server1 /path/to/earFiles/ETFTrade.ear 100 true';
$ssh->setTimeout(1800);
$ssh->exec(
$deploymentScript, function ($str) {
echo $str;
flush();
ob_flush();
});
?>
# cd /path/to/install/phpseclib
# composer require phpseclib/phpseclib
or
# composer require phpseclib/phpseclib:~2.0
http://phpseclib.sourceforge.net/ssh/2.0/examples.html
<?php
require __DIR__ . '/../vendor/autoload.php';
use phpseclib\Net\SSH2;
use phpseclib\Crypt\RSA;
$ssh = new SSH2('web.goweekend.ca');
$key = new RSA();
$key->loadKey(file_get_contents('/home/apache/.ssh/id_rsa'));
if (!$ssh->login('dboard', $key)) {
exit('Login Failed');
}
$deploymentScript = 'sudo /autoDeployment/deployApplication.sh uat install ETFTrade server1 /path/to/earFiles/ETFTrade.ear 100 true';
$ssh->setTimeout(1800);
$ssh->exec(
$deploymentScript, function ($str) {
echo $str;
flush();
ob_flush();
});
?>
Thursday, September 13, 2018
Xcode Programing
Display Position
https://ivomynttinen.com/blog/ios-design-guidelines
https://developer.apple.com/library/archive/qa/qa1686/_index.html
https://developer.apple.com/design/human-interface-guidelines/ios/overview/themes/
https://youtu.be/QyjyWUrHsFc
https://ivomynttinen.com/blog/ios-design-guidelines
https://developer.apple.com/library/archive/qa/qa1686/_index.html
https://developer.apple.com/design/human-interface-guidelines/ios/overview/themes/
https://youtu.be/QyjyWUrHsFc
Thursday, July 26, 2018
PHP Mongodb Insert/Update Document with Array
http://php.net/manual/en/class.mongodb-driver-manager.php
$conn = new Mongo();
$q = $conn->server->gameQueue;
$id = new MongoId("4d0b9c7a8b012fe287547157");
$q->update(array("_id"=>$id),array('$push' => array("done_by","2")));
There is a problem with your $push statement, you are not pushing "done_by" with a value of "2" you are actually sending "done_by" and "2" ...
Here is the issue ...
array('$push' => array("done_by","2"))
This should have a => not a ,
array('$push' => array("done_by" => "2"))
However, note that every time you run this it will insert another "2" if you want MongoDB to only inset "2" if it doesn't already exist in "done_by" then you should use $addToSet ...
array('$addToSet' => array("done_by" => "2"))
This statement won't add 2 everytime, only the first time.
Credit:
https://stackoverflow.com/questions/4638368/push-new-value-to-mongodb-inner-array-mongodb-php
Tuesday, January 23, 2018
Setup PHP environment
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
yum install composer
composer require phpmailer/phpmailer
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install composer
composer require phpmailer/phpmailer
Subscribe to:
Posts (Atom)