Skip to content

Instantly share code, notes, and snippets.

View utamori's full-sized avatar
🏠
Working from home

mori yuta utamori

🏠
Working from home
View GitHub Profile
@nukosuke
nukosuke / Makefile
Created October 22, 2016 02:31
みんなのGo言語に載っているMakefileタスクのテンプレ
# メタ情報
NAME := myproj
VERSION := $(shell git describe --tags --abbrev=0)
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X 'main.version=$(VERSION)' \
-X 'main.revision=$(REVISION)'
# 必要なツール類をセットアップする
## Setup
setup:
@dmail
dmail / url.js
Last active January 5, 2024 11:09
URL parts naming. Inspired from web browsers API (new URL(), window.location) and rfc3986.
/*
href
┌────────────────────────────────────────┴──────────────────────────────────────────────┐
origin │
┌────────────┴──────────────┐ │
│ authority │
│ ┌───────────────┴───────────────────────────┐ │
│ │ host resource
│ │ ┌──────────┴─────────────────┐ ┌────────────┴───────────┬───────┐
│ │ hostname │ pathname │ │
@gakuzzzz
gakuzzzz / 0.md
Last active July 23, 2022 01:52
EnumReverseLookup

共通コード

public class EnumReverseLookup<E extends Enum<E>, ATTR> {

    private final Class<E> enumClass;
    private final Function<E, ATTR> getter;

    public EnumReverseLookup(final Class<E> enumClass, final Function<E, ATTR> getter) {
        this.enumClass = enumClass;

明日の下書き


これはなに

  • 高円寺.dev #3 用の資料 https://koenji.connpass.com/event/160886/
  • フロントエンド専門じゃない人向けの、フロントエンドの最先端〜やや未来の話です
  • このレイヤーでは Node.js を使うべき/使うと強いという部分がありますが、他言語を否定しているわけではありません。むしろ他言語でこのアーキテクチャを模倣してほしいという話です。
@sindresorhus
sindresorhus / esm-package.md
Last active July 7, 2024 17:10
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
import 'dart:async';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';
final sharedPreferencesProvider = Provider<SharedPreferences>(
(ref) => throw UnimplementedError(),
// https://pub.dev/packages/clock
import 'package:clock/clock.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:intl/intl.dart';
final clockProvider = Provider((ref) => const Clock());
final someTimeService = Provider(SomeTimeService.new);
class SomeTimeService {
class PackageMetrics
// AutoDispose/Family版のAsyncNotifier
extends AutoDisposeFamilyAsyncNotifier<PackageMetricsScore, String> {
late String _packageName;
@override
Future<PackageMetricsScore> build(String arg) {
_packageName = arg;
return ref
.watch(pubRepositoryProvider)
.getPackageMetrics(packageName: _packageName);
@naporin0624
naporin0624 / README.md
Last active February 24, 2024 03:14
cloudfire D1 と DurableObjects で firestore の夢を見る
import 'dart:async';
import 'dart:ui';
import 'package:scandit_flutter_datacapture_barcode/scandit_flutter_datacapture_barcode.dart';
import 'package:scandit_flutter_datacapture_barcode/scandit_flutter_datacapture_barcode_capture.dart';
import 'package:scandit_flutter_datacapture_core/scandit_flutter_datacapture_core.dart';
const String licenseKey = 'AfeCTXVfRq2YPHgW8TFeSSwGXJXGAYbWKkqcvrlKHEhSfEBsF3phC4lE+WUTWSP52isK0gQSUGQAUIYI0mt/cvNETJknZfBYWwTEBttgjoibRyGfJkLvz8BeBfoFc++QHkOZe6lFiLUoW7X1NlS/x6d+ExVAQ7Wrekhix442XQj4byuK6nqpnMhW2gIFNteLH3noYalQVl6yfAO9Ln0iKtt1xo7aUA5R1VICz+hq+kOjS0+S52HzbxlqORFQZMWPZU1LaYssrr5KbyZezjD8BqdiIOBjc5zHaG3XWqZJscAIc9IPUlg/UxJD/NEya9JyD0GtJ8tp6cAAdrxV6k2XVetdbR3XY3zUW0+DuPt9TJ8eWK43lS9rZot/2oL0Up9v9D2e4dllpXVZaxQCxUXRbq9yqFGmYs8q8m+kmaxGv3u6L09hBmcc9nRtwCm6SAcEj0AJxRR0/wV0Ay3RvFwa2BNDL74/ftLwU3THgepCAAAbIpZrjHsIxiFYMVb+XeuzShCqMHMqk9tdDUzdTjxeckvvGi+7G6LBsyBuIzvgSHQlBJw6qyTo6vCiS4WPFVtANCplfn4U5XdQt/bTr9ZcfRih6QZA/NlADDaQr1+PvJQbLnPbpFRaCXkyuAazN6gNyKZvKox3mwbC4ZkHDJSFZMZE35FYx