Skip to content

Instantly share code, notes, and snippets.

View unalman's full-sized avatar
🥰
Consistency

Sadık Ünal Çokünlü unalman

🥰
Consistency
View GitHub Profile
@LewisJEllis
LewisJEllis / getRelativeTimeString.ts
Last active August 25, 2024 12:55
Simplified getRelativeTimeString
// from https://twitter.com/Steve8708/status/1504131981444980739
// simplified to a function body of 8 tidy lines
// no loop needed, no 2d array of 3-tuples needed
// just 2 arrays, a findIndex call, and some indexing :)
export function getRelativeTimeString(
date: Date | number,
lang = "en"
): string {
const timeMs = typeof date === "number" ? date : date.getTime();
@tommyready
tommyready / CloudFlareApiClient.cs
Last active January 4, 2024 17:52
Update Cloud Flare DNS Record via Cloud Flare API v4 using C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using Newtonsoft.Json;
namespace CloudFlareApiClient
{
class Program
{