Init script for Jackrabbit in a Vagrant box (tested on Ubuntu trusty only). I am not an advanced bash developer, so don't hesitate to contribute!
Copy this script in your /etc/init.d directory:
| ### BEGIN INIT INFO | |
| # Provides: webhook | |
| # Required-Start: $local_fs $network $named $time $syslog | |
| # Required-Stop: $local_fs $network $named $time $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: GitHub webhook | |
| # Description: This webhook handles GitHub events. | |
| ### END INIT INFO |
| # Load ssh keys | |
| ssh-add -l >> /dev/null | |
| if [ ! $? -eq 0 ]; then | |
| echo "SSH keys loading..." | |
| ssh-add -A | |
| fi |
| <html> | |
| <style> | |
| html, body, .container { | |
| height: 100%; | |
| } | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| background-color: #eee; |
| <?php | |
| return [ | |
| '01' => 'Rhône-Alpes', | |
| '02' => 'Picardie', | |
| '03' => 'Auvergne', | |
| '04' => 'Provence-Alpes-Côte d\'Azur', | |
| '05' => 'Provence-Alpes-Côte d\'Azur', | |
| '06' => 'Provence-Alpes-Côte d\'Azur', | |
| '07' => 'Rhône-Alpes', |
| class MyFuckingIterator | |
| { | |
| public function __construct() | |
| { | |
| $this->data = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($data)); | |
| } | |
| } |
| var now = new Date(); | |
| var valuatedAt = new Date(); | |
| var maxTime = new Date(); | |
| valuatedAt.setMinutes(now.getMinutes() - 1); | |
| maxTime.setMinutes(valuatedAt.getMinutes()); | |
| maxTime.setSeconds(valuatedAt.getSeconds() + 80); | |
| console.log('Initialization....'); | |
| console.log('now: ' + now); |
| #!/bin/bash | |
| urlencode() { | |
| # urlencode <string> | |
| # from https://gist.github.com/cdown/1163649 | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:i:1}" | |
| case $c in |
| #!/bin/bash | |
| urlencode() { | |
| # urlencode <string> | |
| # from https://gist.github.com/cdown/1163649 | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:i:1}" | |
| case $c in |
| <?php | |
| namespace Martial\UploadBundle\Controller; | |
| use Martial\UploadBundle\Entity\Image; | |
| use Martial\UploadBundle\Form\Type\ImageType; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| class DefaultController extends Controller | |
| { |