This file contains hidden or 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
import AppKit | |
import QuartzCore | |
import PlaygroundSupport | |
// Parameters that define the style | |
let hexSideLength: CGFloat = 15.0 | |
let hexLineWidth: CGFloat = 3.0 | |
let colors = [NSColor.red, NSColor.cyan, NSColor.green, NSColor.yellow, NSColor.red].map { $0.cgColor } |
This file contains hidden or 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
<?php | |
class DateIntervalEnhanced extends DateInterval { | |
/* Keep in mind that a year is seen in this class as 365 days, and a month is seen as 30 days. | |
It is not possible to calculate how many days are in a given year or month without a point of | |
reference in time.*/ | |
public function to_seconds() { | |
return ($this->y * 365 * 24 * 60 * 60) + | |
($this->m * 30 * 24 * 60 * 60) + | |
($this->d * 24 * 60 * 60) + |
NewerOlder