Skip to content

Instantly share code, notes, and snippets.

View Doko-Demo-Doa's full-sized avatar
💭
Not even my mind is safe

Quan Pham Doko-Demo-Doa

💭
Not even my mind is safe
View GitHub Profile
@Doko-Demo-Doa
Doko-Demo-Doa / jest.setup.ts
Created February 15, 2024 16:43
Sample Jest setup file with mocking
// https://github.com/react-navigation/react-navigation/issues/9727
jest.useFakeTimers();
import "@testing-library/jest-native/extend-expect";
import "react-native-gesture-handler/jestSetup";
import type {
UnistylesBreakpoints,
UnistylesThemes,
} from "react-native-unistyles";
@Doko-Demo-Doa
Doko-Demo-Doa / custom-component.tsx
Created February 9, 2024 03:55
Custom Component, simple version
import { PropsWithChildren } from "react";
import { StyleSheet } from "react-native";
import {
TouchableOpacity,
TouchableOpacityProps,
} from "~/components/overrides";
import { createStyleSheet, useStyles } from "~/utils/theme-utils";
interface Props extends PropsWithChildren, TouchableOpacityProps {
variant?: "blue" | "purple" | "default";
@Doko-Demo-Doa
Doko-Demo-Doa / matrix.json
Created May 17, 2023 04:59
Sample Matrix Room message
{
"chunk": [
{
"type": "m.room.create",
"room_id": "!WFBiWLWvPmrLwVMmhQ:matrix.tauhu.cloud",
"sender": "@quanrens:matrix.tauhu.cloud",
"content": {
"room_version": "10",
"creator": "@quanrens:matrix.tauhu.cloud"
},
@Doko-Demo-Doa
Doko-Demo-Doa / modify.js
Created April 29, 2023 17:39
Array Filtering (also modify the original array)
function modify(arr) {
let i = 0
while (i < arr.length) {
if (isNaN(arr[i])) {
arr.splice(i, 1)
--i
} else {
i++
}
}
@Doko-Demo-Doa
Doko-Demo-Doa / Fulfilled
Created January 10, 2023 19:19
Shopify Webhook Data Sample (Fulfilled)
{
"id": 820982911946154500,
"email": "jon@doe.ca",
"closed_at": null,
"created_at": "2023-01-10T21:18:40+02:00",
"updated_at": "2023-01-10T21:18:40+02:00",
"number": 234,
"note": null,
"token": "123456abcd",
"gateway": null,
@Doko-Demo-Doa
Doko-Demo-Doa / desktop-wallpapers.txt
Last active November 19, 2022 17:43
Dora-World Wallpaper List
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202211.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202210.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202209.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202208.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202207.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202206.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202205.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202204.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202203.png
https://dora-world.com/assets/images/wallpaper/PC_wallpaper_202202.png
@Doko-Demo-Doa
Doko-Demo-Doa / javascript-react.md
Created November 2, 2021 09:43
JS/React convention
title sidebar_label
JavaScript/React
JavaScript/React

Sau đây là quy ước code JavaScript chung của team, áp dụng chủ yếu cho phía Frontend / Mobile React Native.

  1. Chỉ sử dụng phiên bản Node LTS mới nhất (hiện là 14). Nếu sử dụng nvm thì lện cài đặt là:
@Doko-Demo-Doa
Doko-Demo-Doa / Clannad_OP.py
Created February 14, 2021 08:23
Clannad_OP.py
# -*- coding: cp1252 -*-
from random import *
from string import *
from time import *
from ssa_pawaa_xd import *
TEM_INI_PRO = time()
# [dimensions và fps]
COL_INI_SCR = 0 # ô d?c ??u tiên c?a script
import com.yourapp;
import com.facebook.react.modules.network.OkHttpClientProvider; // Import this.
...
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
...
package com.yourapp;
import com.facebook.react.modules.network.OkHttpClientFactory;
import com.facebook.react.modules.network.ReactCookieJarContainer;
import okhttp3.OkHttpClient;
public class CustomNetworkModule implements OkHttpClientFactory {
@Override
public OkHttpClient createNewNetworkModuleClient() {