This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// it's 4am somewhere | |
const moment = require('moment-timezone'); | |
console.log(moment.tz.names().filter(tz => moment.tz(new Date(), tz).hour() === 4)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://www.apache.org/licenses/LICENSE-2.0.txt | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace UngroupExtension | |
{ | |
public static class UngroupExtension | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn partition-between | |
"Splits coll into a lazy sequence of lists, with partition | |
boundaries between items where (f item1 item2) is true. | |
(partition-between = '(1 2 2 3 4 4 4 5)) => | |
((1 2) (2 3 4) (4) (4 5))" | |
[f coll] | |
(lazy-seq | |
(when-let [s (seq coll)] | |
(let [fst (first s)] | |
(if-let [rest-seq (next s)] |