Skip to content

Instantly share code, notes, and snippets.

View sawich's full-sized avatar
🔪
Yandere Cafe

sawich

🔪
Yandere Cafe
View GitHub Profile
@b4n92uid
b4n92uid / DateMixin.js
Last active July 12, 2022 19:54
[Vue] DateMixin
import { format, parseISO, formatDistanceToNow } from "date-fns";
import { fr, arDZ } from "date-fns/locale";
const locales = { fr, ar: arDZ };
function formatDate(str) {
if (typeof str === "string") str = parseISO(str);
return format(str, "dd/MM/yyyy");
}
@AArnott
AArnott / Cancellation.cs
Last active December 12, 2023 16:33
Graceful console app cancellation on Ctrl+C
class Program
{
static async Task Main(string[] args)
{
// Add this to your C# console app's Main method to give yourself
// a CancellationToken that is canceled when the user hits Ctrl+C.
var cts = new CancellationTokenSource();
Console.CancelKeyPress += (s, e) =>
{
Console.WriteLine("Canceling...");
@gokulkrishh
gokulkrishh / media-query.css
Last active May 5, 2024 08:25
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */