Skip to content

Instantly share code, notes, and snippets.

View main.dart
void main() {
var users = ["a","b","c"];
var tasks = 10;
print(roundRobin(users,tasks));
}
Map<N, List<T>> roundRobin<N, T>(List<N> names, int taskCount, T createTask(int number)) {
var tasks = [for (var i = 0; i < names.length; i++) <T>[]];
for (var i = 0, j = 0; i < taskCount; i++) {
@cngeru
cngeru / sundaysInMonth.js
Last active Jan 14, 2021
Get all sundays a month or get "specific day of week" in a month using dayjs (In the future)
View sundaysInMonth.js
func getSundays {
let startTime = 1234294232 // unix timestamp of a day in paricular
const startTimeObj = dayjs.unix(startTime)
const startOfDay = dayjs().startOf('day',startTimeObj)
const endOfMonth = dayjs().endOf('month',startTimeObj)
const days = []
let pastEndMonth = false
let newDay = startOfDay.add(7, 'days')
do {
View index.html
<canvas id="surface" width="600" height="400"></canvas>