Download and install redis
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
| "use strict"; | |
| const arr = [ 1, 2, 3, 4, 5]; | |
| let max = arr.reduce((a, b) => { | |
| return a > b ? a : b; | |
| }, 0); | |
| console.log(max); |
| <?php | |
| $dt = strtotime("2017-01-09 08:59:35"); | |
| $format = 'Y-m-d'; // format 'j/n/Y' gives wrong output if used for comparing two dates ('Y-m-d' is working) | |
| $date_limit = date($format, strtotime('+0 months', $dt)); | |
| $dt_now = date($format); | |
| if($date_limit > $dt_now) { | |
| echo $date_limit . " is greater than " . $dt_now; | |
| } else { | |
| echo $date_limit . " is less than " . $dt_now; |
| var dogs = ['Shuggy', 'Bobo', 'Whity', 'Moby', 'Molly', 'Charlie', 'Bolly', 'Chappie', 'Bella']; | |
| var b_dogs = dogs.filter(function(dog) { | |
| return startsWithB(dog); | |
| }); | |
| function startsWithB(dog) { | |
| return dog.startsWith("B"); | |
| } |
| var completed = 30; | |
| var target = 30; | |
| var progress = Math.ceil(completed / target * 100); | |
| console.log(progress); |
| [program:laravel_queue] | |
| command=/usr/local/bin/run_queue.sh | |
| autostart=true | |
| autorestart=true | |
| stderr_logfile=/var/log/laraqueue.err.log | |
| stdout_logfile=/var/log/laraqueue.out.log |
| var goLeft = function() { | |
| console.log('to left'); | |
| }; | |
| var goRight = function() { | |
| console.log('to right'); | |
| }; | |
| var goUp = function() { | |
| console.log('to up'); |
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: redis-server | |
| # Required-Start: $syslog $remote_fs | |
| # Required-Stop: $syslog $remote_fs | |
| # Should-Start: $local_fs | |
| # Should-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: redis-server - Persistent key-value db |