Skip to content

Instantly share code, notes, and snippets.

View hyochan's full-sized avatar
🎯
Focusing

Hyo hyochan

🎯
Focusing
View GitHub Profile
@hyochan
hyochan / eas.json
Created October 25, 2023 07:40
eas.json
{
"cli": {
"version": ">= 3.8.1"
},
"build": {
"development": {
"channel": "development",
"developmentClient": true,
"distribution": "internal",
"android": {
@hyochan
hyochan / gist:224b42da1f0e393b6b5e473638865c2b
Created March 1, 2023 07:58
Firebase storage cors settings
## First open up terminal in https://console.cloud.google.com. Click button in right hand corner to open the terminal.
## Add to `cors-config.json`
echo '[{"origin": ["[YOUR-DOMAIN]"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json
## Set with gsutil
gsutil cors set cors-config.json gs://[YOUR-PROJECT-ID].appspot.com
## Checkout your input
gsutil cors get gs://wecount-2023.appspot.com
@hyochan
hyochan / query_service.dart
Last active January 17, 2023 09:01
Solving firestore whereIn query limitation
import '../utils/firebase_config.dart';
abstract class IQueryService {
Future<List<T>> getWhereInQueryList<T>({
required List<Object> whereInList,
required CollectionReference<Map<String, dynamic>> reference,
int size,
startAfter,
});
}
@hyochan
hyochan / flat_list.dart
Last active November 12, 2022 09:37
flutter flat list code snippet
import 'package:flat_list/flat_list.dart';
import 'package:flat_list_example/common_views.dart';
import 'package:flat_list_example/data.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
class FlatListEx1 extends HookWidget {
static const name = '/flat-list-ex1';
const FlatListEx1({super.key});
@hyochan
hyochan / gist:0db38702fa4342f7c6d5231613da4090
Created August 2, 2021 02:48
Github emoji for commit messages
// https://gist.github.com/parmentf/035de27d6ed1dce0b36a#gistcomment-3664222
Chore ⚙️ :gear:
CI 🚀 :rocket:
Documentation 📝 :memo:
Feature ⭐ :star:
Fix / Bug 🐞 :beetle:
Performance ⚡️ :zap:
Release 🔖 :bookmark:
Tests 🧪 :test_tube:
@hyochan
hyochan / SignIn.tsx
Last active July 17, 2021 13:51
Sample of relay queries
import {Button, EditText} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {RootStackNavigationProps} from '../navigations/RootStack';
import styled from '@emotion/native';
const Container = styled.View`
flex: 1;
background-color: transparent;
padding: 0 40px;
@hyochan
hyochan / ResettableRelayProvider.tsx
Created July 17, 2021 03:17
Resettable relay provider will let you fully reset the cache of the relay client. Useful when you want to clear cache when user sign out.
import React, {FC, useState} from 'react';
import {IEnvironment} from 'relay-runtime';
import {RelayEnvironmentProvider} from 'react-relay/hooks';
import createCtx from '../utils/createCtx';
interface Context {
/**
* Current Relay environment.
*/
@hyochan
hyochan / convertBase64ToFileInWeb.ts
Last active July 18, 2022 21:49
expo image upload in both web and mobile
const fileName = uri.split('/').pop();
const fileType = mime.getType(uri);
const data: FormData = new FormData();
if (Platform.OS === 'web') {
const byteString = atob(uri.split(',')[1]);
const ab = new ArrayBuffer(byteString.length);
const arr = new Uint8Array(ab);
@hyochan
hyochan / ResettableRelayProvider.tsx
Created May 15, 2021 07:41
ResettableRelayProvider.tsx
import React, {FC, useState} from 'react';
import {IEnvironment} from 'relay-runtime';
import {RelayEnvironmentProvider} from 'react-relay/hooks';
import createCtx from '../utils/createCtx';
interface Context {
/**
* Current Relay environment.
*/
@hyochan
hyochan / fbt.ts
Created November 8, 2020 12:23
FBT initializing util
import { init } from 'fbt';
import intl from '../../assets/translatedFbts.json';
const DEFAULT_LOCALE = 'en';
export const viewerContext = {
locale: DEFAULT_LOCALE,
};
export const initFbt = (): void => {