Skip to content

Instantly share code, notes, and snippets.

@mihdan
mihdan / wp_session_expiration.php
Last active August 7, 2021 12:55
Время жизни серверной сессии в WordPress при использовании плагина wp-session-manager (например он интегрирован в WooCommerce)
<?php
/**
* Время жизни серверной сессии при использовании плагина wp-session-manager
* (например, он интегрирован в WooCommerce)
*
* @link https://github.com/ericmann/wp-session-manager
*
* @param int $length - секунды
*
* @return int
@ChengLong
ChengLong / ruby_cron.md
Created April 17, 2014 06:34
Run Ruby Script using cron job

If you see this error when cron job runs a ruby script:

'require': cannot load such file ...

And you are using bundler e.g. require 'bundler/setup'. It's probably because the directory where cron runs the script is not correct, resulting in bundler fails to load gems.

Simply changed the directory to fix it, i.e.

* * * * * /usr/local/bin/ruby -C /home/example/scripts example_script.rb >>/home/example/log/cron.log 2>&1