Set Slackbot a reminder for every weekday except Wednesday - slack

I'm looking for something like
/remind #channel "It's time for daily stand up !" Monday Tuesday Thursday Friday at 11:45am. Click here to join: Link.

/remind #channel "It's time for daily stand up !" every Monday and Tuesday and Thursday and Friday

You have many possibilities.
Example (implicit, weekday):
/remind #channel "It's time for daily stand up!" every weekday
or (long way, day list):
/remind #channel "It's time for daily stand up!" every Monday and Tuesday and Wednesday and Thursday and Friday
and you can also add a specific time, for example:
/remind #channel "It's time for daily stand up!" at 9AM every weekday
Docs:
https://slack.com/intl/en-gb/help/articles/208423427-Set-a-reminder

Related

How do you psuedocode this problem? How do simplify this problem before writing the code?

Your week is almost always the same. On the list of things to do for the day, you brush your teeth, take a shower, eat breakfast, drive your car to work, work/field work/meetings, come home, eat dinner at home, sleep. There are some days where your activities change.
On Wednesdays, you don’t eat breakfast as you need to be really early for work.
Monday, Wednesday and Friday, you have office work, while you have meetings on Tuesday, and field work on Thursday.
On Tuesdays, you take the bus instead of driving since your car is coding on that day.
On Fridays, you eat dinner out with your family and watch a movie.
Create pseudocode that shows your week detailed activities. TAKE NOTE that you can only use one loop.
I have researched about adding and removing in arrays.
Looked into nested loops but it requires just 1 loop
var week = [monday ,tuesday, wednesday, thursday, friday]
var toDo = [Brush teeth ,take shower ,eat breakfast ,drive car ,work ,come home ,eat dinner at home]
for (day in week) {
var monday += toDo;
}
return monday
Just wanted your version on how you will approach / pseudocode this problem.
Since you can only use one loop, a second array (toDo) isn't of use, since a second loop would be needed to process that. A possible approach is:
var week = [Monday, Tuesday, Wednesday, Thursday, Friday]
for day in week
{
brush teeth
take shower
if day is not Wednesday, eat breakfast
if day is Tuesday, take bus, else drive car to work
if day is Monday, Wednesday or Friday, office work
else if day is Tuesday, meetings
else (day is Thursday) field work
come home
if day is Friday, eat dinner out and watch movie, else eat dinner at home
sleep
}

How do I get slack to remind me every fortnight from next Saturday

Slack has the /remind command that allows you to set a reminder in a channel. I am trying to have slack remind me every fortnight starting from next Saturday at 8pm to jump on a call. It seems like an extension of the help documentation.
I tried:
/remind #here Fortnightly planning and retro every fortnight from saturday at 8pm
but it didn't work and the reminder states:
I will remind space-racing “planning and retro every fortnight from saturday at 8pm” at 9AM every other Saturday (next occurrence is April 22nd).
Any thoughts? thanks in advance
I was trying to do this today also. Either of these options work:
Needs to be run the week before you want it to start:
/remind me to "ABC" every other Saturday 8pm
/remind me to "ABC" Saturday 8pm every 2 weeks
Otherwise specify the start date
/remind me to "ABC" Jun 19th 8pm every 2 weeks
/remind me to "ABC" next Saturday 8pm every 2 weeks
Slackbot told me:
I will remind you to “ABC” at 8PM every other Saturday (next occurrence is June 19th).
Only achievable when setting a reminder <7 days when the first occurrence should happen. For example if you want to set the reminder at Saturday May 9th at 8pm, the earliest you can set the reminder is Saturday May 2nd 8:01pm
Then you run a command like so:
/remind #my-channel #my-group-to-notify This is my reminder message at 8pm every other Saturday
You can skip the channel or group of course. But it's nice if you run some team ceremonies and want to set reminder to specific people to attend a meeting etc.
Hint: you always set the time as per your current timezone, if other people are in different time zone the reminder will be at their time, so you don't need to worry that 8pm might be for them later/earlier. You all will see reminder in the same moment.
You can specify the starting date by the keyword starting at the end.
/remind #my-channel #my-group-to-notify This is my reminder message at 8pm every other Saturday starting April 29nd
But you need to set this. they week before you want to get notified.
For e.g Today is 7th September 2018 ( Friday) and you want to get notified on 21st September 2018 ( Friday ) i.e second Friday after today ( Friday ).
you need to use this command on next Friday. ie. on 14th September 2018 , use this command and slack will start reminding you after every other( second ) friday.
Example Command on SlackBot :
/remind me to "Send : Time Sheet" every other Friday 11am

How to set Slack reminder for a range of dates

For example, I want a reminder to appear each day in a specific channel for the days I am off. Something like:
/remind #channel #me will be on PTO 1/1/2016 until 1/5/2016
And then each day in that range a reminder will appear in the channel saying the range of dates.
What would be the command/syntax to achieve that or as close to that as possible?
[Edit: outdated, no longer works]
The following worked.
/remind #channel "#me will be on PTO from 1/1/2016 until 1/5/2016." every weekday until 1/5
It results in the following being posted every weekday at 9am in #channel
"#me will be on PTO from 1/1/2016 until 1/5/2016."

How to get user hour of the week in Ruby

I want to get the current hour of the week in which day starts from Sunday.
Consider current time is
Time.now
=> 2014-10-29 12:09:23PM +0530
The result should be : 84
Explanation:
Sunday - 24 hours
Monday - 24 hours
Tuesday - 24hours
Wednesday - 12 hours
Total: 84
How can get the user hour of the week. Is there any method available in Ruby ? Or how to do it without Ruby method.
You can get the day of the week and hour of the day using Time#wday and Time#hour.
Time.now.wday
#=> 3
Time.now.hour
#=> 14
The rest is basic mathematics.
Even though I upvoted Yu Hao, I must say it's not a good approach if you want to pay attention to the concerns Jon Skeet raised. To that end, here's another approach:
(Time.now - (Date.today - Date.today.wday).to_time) / 3600
Date.today is, well, today. If you subtract the number of days since the week started, you get Sunday. Convert it to Time and it's the midnight when Sunday began. Subtraction gives you number of seconds between then and now. Divide by 3600 (and optionally round) to get number of hours. The DST details should be transparently handled by Time#-.
EDIT: Timezones... Run this before:
ENV['TZ']='EST5EDT'
(be sure to reset it back to what it used to be afterwards, in case anyone else needs to know time and didn't count on you switching timezones.) You can also use "America/New_York" instead. See tz list for details.

Can I specify week 0 in ice_cube gem when I want to a job to run every 2 weeks?

I have this recurring job in our Rails service that sends out emails on Friday every two weeks. However, based on our business requirement, the first week of the "every two weeks" schedule should be this week, which means the email should be sent out this Friday, and then 2 weeks after that, and 4 weeks after that, etc.
The schedule shouldn't be broken when the service restarts. For example, after the email is sent out this Friday, if I restart the service on Saturday, it shouldn't schedule the job to Friday next week -- should still be the Friday of the week after next week. In short, the week 0 should be persistent and stick to this week.
Is it doable in ice_cube? Or are there any other better solution? Thank!
Setting "week 0" is built into IceCube. When you create the schedule, specify the start time rather than Time.now.
2.1.4 :012 > s = IceCube::Schedule.new(Time.now.beginning_of_month)
2.1.4 :013 > s.add_recurrence_rule IceCube::Rule.monthly.count(3)
2.1.4 :014 > s.all_occurrences
=> [2014-12-01 00:00:00 -0500, 2015-01-01 00:00:00 -0500, 2015-02-01 00:00:00 -0500]
Here, I told IceCube the schedule starts at the beginning of this month, although I could have used any value. IceCube computes the schedule based on that time, giving me Dec 1, Jan 1, and Feb 1.

Resources