Skip to content

Instantly share code, notes, and snippets.

@onildoaguiar
onildoaguiar / sorting-an-array-by-date-with-moment-js.md
Last active May 21, 2024 15:15
Sorting an array by date with Moment.js
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)
@koshatul
koshatul / README.md
Last active May 7, 2025 14:29
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@melvinkcx
melvinkcx / celery_app.py
Created September 17, 2020 14:26
Configure Celery To Write Logs To Papertrail
import logging
import os
from celery import Celery
from celery.schedules import crontab
from celery.signals import after_setup_logger, after_setup_task_logger
from django.conf import settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")