const Moment = require('moment')
const array = [{date:"2018-05-11"},{date:"2018-05-12"},{date:"2018-05-10"}]
const sortedArray = array.sort((a,b) => new Moment(a.date).format('YYYYMMDD') - new Moment(b.date).format('YYYYMMDD'))
console.log(sortedArray)
Discover gists
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
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
foreach (var relationship in modelBuilder.Model.GetEntityTypes().SelectMany(e => e.GetForeignKeys())) | |
relationship.DeleteBehavior = DeleteBehavior.Restrict; | |
} |
Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs
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
import SwiftUI | |
/// Supplies an observable object to a view’s hierarchy. | |
/// | |
/// The purpose of `WithBindable` is to make it possible to instantiate | |
/// observable objects from environment values, while keeping the object | |
/// alive as long as the view is rendered. | |
/// | |
/// For example: | |
/// |
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
import UIKit | |
protocol StepAnimatable { | |
/// Start a sequence where you add each step in the `addSteps` closure. Use the provided `AnimationSequence` object | |
/// to add each step which should either be an actual animation or a delay. | |
/// The `completion` closure is executed when the last animation has finished. | |
/// - Parameters: | |
/// - addSteps: Closure used to add steps to the provided `AnimationSequence` object | |
/// - completion: Executed when the last animation has finished. |
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
blueprint: | |
name: Low Battery Notifications & Actions | |
description: > | |
# 🪫 Low Battery Notifications & Actions | |
**Version: 2.1** | |
🚀 Stay Charged, Stay Smart! Let's automate and take charge of your battery maintenance!🔋⚡ | |
Google Fonts suggests syncing fonts to your computer with a tool called SkyFonts. However, if you're running MacOS and want to keep your machine updated with all Google Fonts without any extra software, you can do this with Git, thanks to the Google Fonts Repo.
To do this, run the following in your terminal:
cd ~/Library/Fonts/
git clone --depth 1 https://github.com/google/fonts.git google-fonts
Done! In the future, you can download new fonts by running:
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
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################ | |
############ also be sure to RESTART OpenProject after replacing the file. ################ | |
############ it doesn't show that enterprise mode is enabled in the settings, but all ################ | |
############ enterprise mode features, such as KanBan boards, are enabled. ################ | |
#-- copyright | |
# OpenProject is an open source project management software. | |
# Copyright (C) 2012-2023 the OpenProject GmbH | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License version 3. |
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
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################ | |
############ also be sure to RESTART OpenProject after replacing the file. ################ | |
############ it doesn't show that enterprise mode is enabled in the settings, but all ################ | |
############ enterprise mode features, such as KanBan boards, are enabled. ################ | |
#-- copyright | |
# OpenProject is an open source project management software. | |
# Copyright (C) 2012-2023 the OpenProject GmbH | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License version 3. |
NewerOlder