Skip to content

Instantly share code, notes, and snippets.

// 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 {
@lohanidamodar
lohanidamodar / firestore_service.dart
Created February 19, 2020 02:30
Flutter firestore generic helper class
import 'package:cloud_firestore/cloud_firestore.dart';
class DatabaseService<T> {
final String collection;
final Firestore _db = Firestore.instance;
final T Function(String, Map<String,dynamic>) fromDS;
final Map<String,dynamic> Function(T) toMap;
DatabaseService(this.collection, {this.fromDS,this.toMap});
Future<T> getSingle(String id) async {
var snap = await _db.collection(collection).document(id).get();
if(!snap.exists) return null;
@ryu22e
ryu22e / .gcloudignore
Last active December 30, 2018 04:59
Responder==1.0.1( http://python-responder.org/ )で作ったアプリをGAE/Python3.7で動かすサンプル
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 4, 2024 06:22
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@andrisasuke
andrisasuke / install_m2crypto.txt
Created May 2, 2017 10:12
python install m2crypto on Mac OS X
$> brew install openssl
$> brew install swig
$> env LDFLAGS="-L$(brew --prefix openssl)/lib" \
CFLAGS="-I$(brew --prefix openssl)/include" \
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \
pip install m2crypto
@nownabe
nownabe / .commit_template
Created July 5, 2016 06:54
Emojiで楽しく綺麗なコミットを手に入れる
# ==== Emojis ====
# 🐛 :bug: バグ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 🎉 :tada: 盛大に祝うべき大きな機能追加
# ♻️ :recycle: リファクタリング
# 🚿 :shower: 不要な機能・使われなくなった機能の削除
# 💚 :green_heart: テストやCIの修正・改善
@kotakanbe
kotakanbe / mohikan_slack_channels.md
Last active October 14, 2023 19:26
モヒカンslack( https://mohikan.slack.com )のチャネルリスト
@parmentf
parmentf / GitCommitEmoji.md
Last active May 2, 2024 20:29
Git Commit message Emoji
@vankasteelj
vankasteelj / sec2time.js
Last active February 2, 2024 11:08
Javascript - Seconds to Time (hh:mm:ss,ms) -> sec2time(593.685038) becomes 00:09:53,685
function sec2time(timeInSeconds) {
var pad = function(num, size) { return ('000' + num).slice(size * -1); },
time = parseFloat(timeInSeconds).toFixed(3),
hours = Math.floor(time / 60 / 60),
minutes = Math.floor(time / 60) % 60,
seconds = Math.floor(time - minutes * 60),
milliseconds = time.slice(-3);
return pad(hours, 2) + ':' + pad(minutes, 2) + ':' + pad(seconds, 2) + ',' + pad(milliseconds, 3);
}
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)