Skip to content

Instantly share code, notes, and snippets.

View zidniryi's full-sized avatar
🎯
Focusing

zidniryi zidniryi

🎯
Focusing
View GitHub Profile
import React from "react";
import { SketchPicker } from "react-color";
class App extends React.Component {
state = {
background: "#fff",
};
handleChangeComplete = (color) => {
this.setState({ background: color.hex });
import React, { useState } from 'react';
import { View, Text, StyleSheet, TouchableOpacity, Animated } from 'react-native';
const App = () => {
const [slideAnim] = useState(new Animated.Value(0));
const [isSlideIn, setIsSlideIn] = useState(false);
const slideIn = () => {
Animated.timing(slideAnim, {
toValue: 1,
@zidniryi
zidniryi / opencv.py
Created September 12, 2023 04:29
konsepkoding opencv
import cv2
import numpy as np
import requests
from urllib.request import urlopen
from io import BytesIO
from IPython.display import Image, display
# Function to detect dominant colors in an image
def detect_colors(image_url, num_colors=5):
# Download the image from the URL
@zidniryi
zidniryi / location.py
Created September 7, 2023 10:47
python konsep koding
pip install folium opencage phonenumbers
# track location with the map using the phone number
import phonenumbers
from phonenumbers import geocoder
from phonenumbers import carrier
import folium
@zidniryi
zidniryi / App.js
Created March 15, 2023 03:43
Tutorial Mendapatkan IP Address Pada ReactJS Konsep Koding
import './App.css';
import {useState,useEffect} from 'react'
import axios from 'axios'
function App() {
//creating IP state
const [ip, setIP] = useState('');
//creating function to load ip address from the API
const getData = async () => {
@zidniryi
zidniryi / detect_lang.py
Created February 2, 2023 14:16
detect_lang.py
# Uncoment this if you already install
# !pip install langdetect
from langdetect import detect
text = input("Enter any text in any language: ")
print(detect(text))
@zidniryi
zidniryi / color1.py
Created February 1, 2023 10:21
color konsep koding open cv
# Uncomment and run this code if you not installing yet
# !pip install opencv-python
import cv2
import numpy as np
import pandas as pd
img_path = "/Users/admin/Project/ml_project/colordetection/ikan-hiu.png"
img = cv2.imread(img_path)
@zidniryi
zidniryi / App.test.tsx
Created January 3, 2023 15:21
userEvent test
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import App from "./App";
describe("Render app", () => {
test("should change input value when user type", async () => {
render(<App />);
@zidniryi
zidniryi / App.tsx
Created January 3, 2023 15:20
App Test Konsep Koding User Event
import React, {useState} from 'react'
export default function App() {
const [text, setText] = useState("")
return (
<div style={{marginLeft:"20px"}}>
<h1>Input</h1>
<input value={text} onChange={(e) => setText(e.target.value)} placeholder="input data" data-testid='input-form'/>
</div>
)
@zidniryi
zidniryi / App.test.tsx
Created January 3, 2023 15:12
App.test.tsx Unit Test Konsep Koding
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import App from "./App";
describe("Render app", () => {
test("should change input value when user type", async () => {
render(<App />);