Skip to content

Instantly share code, notes, and snippets.

import * as moment from 'moment'
type DateMlMeasuremnet = {dateString: string, date: moment.Moment, ml: number}
type DailyMlIntakeSummary = { [key: string]: number }
const absDate = (date: moment.Moment): moment.Moment => {
return (moment(date).set({hour: 0, minute: 0, second: 0, millisecond: 0}))
}
@A-Zak
A-Zak / video.html
Created January 11, 2016 15:58
auto playing video tag in a loop
<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls autoplay loop>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
@A-Zak
A-Zak / uiimage_combine.swift
Last active October 30, 2021 09:11
UIImage extension to combine two images
extension UIImage {
class func imageByCombiningImage(firstImage: UIImage, withImage secondImage: UIImage) -> UIImage {
let newImageWidth = max(firstImage.size.width, secondImage.size.width )
let newImageHeight = max(firstImage.size.height, secondImage.size.height)
let newImageSize = CGSize(width : newImageWidth, height: newImageHeight)
UIGraphicsBeginImageContextWithOptions(newImageSize, false, UIScreen.mainScreen().scale)