Skip to content

Instantly share code, notes, and snippets.

View codesnipers's full-sized avatar
😏
I'll catch your code

nexxer codesnipers

😏
I'll catch your code
View GitHub Profile
@codesnipers
codesnipers / upload.tsx
Created July 5, 2023 00:13
upload json read json antd
import React, { useState } from 'react';
import { Upload, Button, message, Typography } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import axios from 'axios';
const { Text } = Typography;
const UploadJSONComponent: React.FC = () => {
const [fileInfo, setFileInfo] = useState(null);
const [jsonObject, setJsonObject] = useState(null);
@codesnipers
codesnipers / dynamic-table-antd-from-json.tsx
Created July 4, 2023 21:43
dynamic table with antd from json
import React, { useEffect, useState } from 'react';
import { Table } from 'antd';
// Create the TableComponent
const TableComponent: React.FC = () => {
const [columns, setColumns] = useState([]);
const [data, setData] = useState([]);
useEffect(() => {
// Fetch the JSON file dynamically
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
@codesnipers
codesnipers / filterArray.js
Created July 8, 2020 09:10 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@codesnipers
codesnipers / Constants.java
Created December 11, 2019 05:57
clean code Constants.java
public class Constants {
// 전역 변수 전용 클래스 임으로 생성자를 사용하지 못하게 함
private Constants() {
}
public abstract class SECURE {
public static final String ANDROID_KEY_STORE = "AndroidKeyStore";
public static final String TRANSFORMATION = "AES/GCM/NoPadding";
}
}
@codesnipers
codesnipers / DeCryptor.java
Last active March 9, 2021 15:15 — forked from JosiasSena/DeCryptor.java
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
public class DeCryptor {
private static final String TRANSFORMATION = "AES/GCM/NoPadding";
private static final String ANDROID_KEY_STORE = "AndroidKeyStore";
private KeyStore keyStore;
Context context;
DeCryptor(Context context) throws CertificateException, NoSuchAlgorithmException, KeyStoreException,
IOException {
this.context = context;
@codesnipers
codesnipers / rpi-update-pack.sh
Created September 13, 2017 00:13
update all rasbperry pi
sudo apt-get dist-upgrade -y && sudo apt-get -y upgrade && sudo apt-get update -y && sudo apt-get autoremove -y && sudo apt-get clean && sudo rpi-update