Skip to content

Instantly share code, notes, and snippets.

View ziweizhou's full-sized avatar

Zhou Ziwei ziweizhou

  • Airhost
  • Singapore
View GitHub Profile
@ziweizhou
ziweizhou / clock.rb
Last active August 29, 2015 14:14
Accrue
require File.expand_path('../../config/boot', __FILE__)
require File.expand_path('../../config/environment', __FILE__)
require 'clockwork'
include Clockwork
every(1.day, 'Yearly Carry Job', :if => lambda { |t| t.day == 1 and t.month == 1}, :at => '0:00'){
now = Time.zone.now
if now.month == 1 and now.day == 1
# clean sick days and personal days