Skip to content

Instantly share code, notes, and snippets.

View sgr-ksmt's full-sized avatar
👉
👁👃👁

Suguru Kishimoto sgr-ksmt

👉
👁👃👁
View GitHub Profile
@sgr-ksmt
sgr-ksmt / dart.json
Created November 6, 2020 13:15
VSCode Snippet: river_pod provider template
{
"prvdr": {
"prefix": "prvdr",
"body": [
"import 'package:hooks_riverpod/hooks_riverpod.dart';",
"final ${1:${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/downcase}${3:/upcase}/g}} = Provider$2((ref) => ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g}(ref.read));",
"",
"class ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g} {",
" const ${TM_FILENAME_BASE/((^[a-z])|_([a-z]))/${2:/upcase}${3:/upcase}/g}(this._read);",
" final Reader _read;",
@sgr-ksmt
sgr-ksmt / zenkaku_hankaku.swift
Last active July 15, 2021 18:55
[Swift] : 文字列の全角/半角の変換 + 数字だけ半角/全角変換
extension String {
private func convertFullWidthToHalfWidth(reverse: Bool) -> String {
let str = NSMutableString(string: self) as CFMutableString
CFStringTransform(str, nil, kCFStringTransformFullwidthHalfwidth, reverse)
return str as String
}
var hankaku: String {
return convertFullWidthToHalfWidth(false)
}
@sgr-ksmt
sgr-ksmt / sample.ts
Created November 15, 2018 09:34
Issue Dynamic Link via Cloud Functions
import * as functions from 'firebase-functions'
import * as request from 'request-promise-native'
export namespace IssueDynamicLink {
export interface Request {
params: DynamicLinkParameters
}
export interface Response {
url: string
@sgr-ksmt
sgr-ksmt / job_description_2020-04-01.md
Last active June 26, 2020 05:03
2020/05以降のお仕事を探しています。

募集

2020年5月以降(早くて4月中旬以降)を目処に、副業先を探しています。

連絡先

TwitterのDM或いは、以下のメールアドレス宛にお願いします。([at]→@)

melodydance.k.s+biz[at]gmail.com
@sgr-ksmt
sgr-ksmt / wrap_example.dart
Created June 7, 2020 16:14
wrap_example.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@sgr-ksmt
sgr-ksmt / firebase_test_helper.ts
Created June 3, 2020 10:00
Helper functions of Firebase test for Cloud Functions and firestore.rules
import * as firebase from '@firebase/testing'
import * as fs from 'fs'
const REAL_FIREBASE_PROJECT_ID = '<please input your firebase project id here>'
export const makeTestProjectID = (projectName = 'test') => {
const hrTime = process.hrtime()
return `${projectName}${(hrTime[0] * 1000000 + hrTime[1] / 1000) * 1000}`
}
@sgr-ksmt
sgr-ksmt / _usage.dart
Last active May 5, 2020 23:42
BouncedWidget
Widget buld(BuildContext context) {
return BouncedWidget.create(
child: const SomeListTile(),
bounce: 0.1,
duration: const Duration(milliseconds: 350),
);
}
@sgr-ksmt
sgr-ksmt / progress_button.dart
Created April 7, 2020 08:33
[Flutter] ProgressButton
import 'package:flutter/material.dart';
@immutable
class ProgressButton extends StatelessWidget {
const ProgressButton({
@required this.title,
@required this.onPressed,
this.processing = false,
this.enabled = true,
});
@sgr-ksmt
sgr-ksmt / main.dart
Last active April 7, 2020 08:33
[Flutter] ProgressButton
import 'package:flutter/material.dart';
@immutable
class ProgressButton extends StatelessWidget {
const ProgressButton({
@required this.title,
@required this.onPressed,
this.processing = false,
this.enabled = true,
});
@sgr-ksmt
sgr-ksmt / baseFunctions.ts
Created April 4, 2020 07:27
Wrap firebase-functions with specified region.
import * as f from 'firebase-functions'
const functions = (runtimeOptions: f.RuntimeOptions = {}) =>
f.runWith(runtimeOptions).region('asia-northeast1')
export default functions