Skip to content

Instantly share code, notes, and snippets.

View ohadeytan's full-sized avatar

Ohad Eytan ohadeytan

View GitHub Profile
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.simulator.parser.TextTraceReader;
import java.io.IOException;
import java.util.stream.Stream;
import java.util.stream.LongStream;
import java.util.AbstractMap.SimpleEntry;
import java.util.Map.Entry;
/**
@ohadeytan
ohadeytan / shabaton.py
Created August 21, 2018 21:28
Python script for checking if today is Shabat or Chag (Jewish holiday)
from datetime import date
from datetime import datetime
from datetime import timedelta
import convertdate
def shabaton(t, eve=False):
if t.weekday() == 5 - 1 if eve else 0:
return True
if t == date(*convertdate.holidays.rosh_hashanah(t.year, eve)):
return True