Skip to content

Instantly share code, notes, and snippets.

View MisterJimson's full-sized avatar

Jason Rai MisterJimson

View GitHub Profile
@MisterJimson
MisterJimson / main.dart
Created April 23, 2022 02:00
CachedIterable
void main() {
final inputs = ['a', 'b', 'c', 'd', 'e', 'f'];
final map = inputs.map((e) {
print(e);
return e;
});
final cachedIterable = inputs.mapCached((e) {
print(e);
return e;
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@MisterJimson
MisterJimson / macos-dock-dont-move.sh
Created March 19, 2024 18:21
macos-dock-dont-move.sh
defaults write com.apple.Dock autohide-delay -float 1000 && killall cfprefsd && killall Dock
@MisterJimson
MisterJimson / local-date.tsx
Created September 24, 2024 20:24
local-date.tsx
'use client';
import { format as dateFnsFormat } from 'date-fns/format';
import dynamic from 'next/dynamic';
import { Skeleton } from '~/components/ui/skeleton';
export const DisplayLocalDate = dynamic(
() => import('./DisplayLocalDate').then((res) => res.DisplayLocalDateClient),
{ ssr: false, loading: () => <Skeleton className="mx-1 h-4 w-20" /> }
);