PHP Notice: Constant CRYPT_RANDOM_IS_WINDOWS already defined After Installing Net_SFTP From phpseclib

Recently I needed a SFTP client to upload file securely from local machine to remote SFTP server. I built a client myself using PHP function “ssh2_scp_send” to upload the file. It worked fine on my local testing environment, but failed on production because our system engineer guy only allowed the …

Use Variable Pattern to Match Regular Expression in Javascript

We all know that to match a particular regular expression in JS, you simply do this: "foo".match(/foo/i); However, if you want “foo” to be a variable: var foo = 'foo'; "foo".match(/foo/i); This becomes confusing and I don’t think it works. To do it properly, do the following instead: var filter …