With help from this article https://github.com/morrisjs/morris.js/issues/346 This is about adding Legends to Morris charts. Though Morris chart shows legend on hovering on the graphs, but I wanted to show a legend permanently on one corner of the chart area. Below are the codes. It is mostly plug and play code The div in which the… Continue reading Legends in Morris Chart
Month: March 2019
PHP substr_replace
Want to mask part of a string – say a API key or the first 12 digits of a credit card? Here is a PHP function for doing the job easily substr_replace(API_USER],”xxxxxxxxxxxx”,6,12); //this will replace 12 characters starting from 6th position substr_replace(API_PASS,”xxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,6,28); //this will replace 28 characters starting from 6th position of the string
Some WordPress Tricks
Redirect some or users to a particular URL after logging in function login_redirect( $redirect_to, $request, $user ) { return ( is_array( $user->roles ) && in_array( ‘sln_staff’, $user->roles ) ) ? “https://mydevfactory.com/~appfactory/salonBooking/wp-admin/admin.php?page=salon” : admin_url(); /* here sln_staff is the admin group for which a redirect will happen after logging in */ } add_filter( ‘login_redirect’, ‘login_redirect’, 10,… Continue reading Some WordPress Tricks
Amazon AWS SDK Passing Credentials
As per the the sample codes the AWS API access key and secret is to be stored in the a file called credentials under a folder named .aws The location of that .aws folder can be set in the code through this config statement putenv(‘HOME=/path/that/you/want/to/set’); But I am more comfortable in passing the credentials through my code… Continue reading Amazon AWS SDK Passing Credentials
RTMP and audio broadcasting — DRAFT
FFMPEG Commands https://gist.github.com/protrolium/e0dbd4bb0f1a396fcb55 https://ffmpeg.org/ffmpeg-formats.html#toc-mov_002c-mp4_002c-ismv http://www.mediaentertainmentinfo.com/2015/06/5-technical-series-handy-ffmpeg-commands-to-get-your-video-processing-done.html/ https://github.com/arut/nginx-rtmp-module/wiki/Examples https://github.com/arut/nginx-rtmp-module/wiki/Directives#exec_options FFMPEG RTSP Commands https://trac.ffmpeg.org/wiki/StreamingGuide https://stackoverflow.com/questions/16658873/how-to-minimize-the-delay-in-a-live-streaming-with-ffmpeg FFMPEG Latency https://www.wowza.com/blog/streaming-protocols-latency https://www.wowza.com/docs/how-to-set-up-low-latency-applications-in-wowza-streaming-engine-for-rtmp-streaming