Skip to content

Instantly share code, notes, and snippets.

View heemoe's full-sized avatar
Coffee time

Huangxi heemoe

Coffee time
View GitHub Profile

Create a component based on the UI image I’ve provided. Please review the code in example.tsx as a reference for best practices before implementing the new component.

  1. Use PageContainer as page wrapper.
  2. Use useQuery to request data, and utilize a mock API with mock data, use placehold.co as mock network image.
  3. Implement pull-down-to-refresh and pull-up-to-load-more features. Pls use YPTActivityIndicator, FBNoMoreData components.
  4. Separate each row item into a single, reusable component.
  5. use VStack, HStack, Spacer for layout, do not use View.
  6. Leverage existing meta components BaseText,BaseImage,BaseButton,BaseIconButton from components/Base.
class javachallenge {
public static int[] rotate(int[] arr) {
int k = 2;
int[] nums = arr;
int length = nums.length;
int left = length - (k % length);
int right = k % length;
int[] newArr = new int[length];
class javachallenge {
public static boolean check(char[] password) {
// Enter your code here
boolean haveDigits = false;
boolean haveLetter = false;
if (password.length >= 8) {
for (int i = 0; i < password.length; i ++) {
if (Character.isDigit(password[i])) {
import java.util.ArrayList;
import java.util.List;
class javachallenge {
public static boolean ugly(int number) {
if (number == 1) return true;
int n = number;
List<Integer> factors = new ArrayList<Integer>();
for (int i = 2; i <= n; i++) {
while (n % i == 0) {
@heemoe
heemoe / custom_switch.dart
Created December 7, 2021 18:19
flutter custom text switch controller
import 'package:flutter/material.dart';
class CustomSwitch extends StatefulWidget {
const CustomSwitch(
{Key? key, required this.leftStr, required this.rightStr, this.onChange})
: super(key: key);
final String leftStr;
final String rightStr;
final Function(int selected)? onChange;
@heemoe
heemoe / hosts2zonefile.py
Created January 18, 2017 12:19
一个将hosts文件转换成bind9 zone文件的脚本
#!/usr/bin/python3
import re
import datetime
import os
#download hosts file path.
hostsFile="hosts"
#zone file save path.
outputZoneFile="hosts.zone"
#target named zone file path
targetZoneFile="/usr/local/named/var/rpz.zone"