Skip to content

Instantly share code, notes, and snippets.

View mityabeldii's full-sized avatar
🌿

Dmytro Beldii mityabeldii

🌿
View GitHub Profile
const deepProxy = (target: Object, callback: (newTarget: Object) => void) => {
const handler = (callback: (newTarget: Object) => void) => ({
get: (obj, prop) => {
if (['[object Object]', '[object Array]'].indexOf(Object.prototype.toString.call(obj[prop])) > -1) {
return new Proxy(
obj[prop],
handler(() => callback(obj)),
);
}
return obj[prop];
@mityabeldii
mityabeldii / useWebworker.js
Created October 20, 2021 15:24
useWebworker
/*eslint-disable*/
import { useEffect, useRef, useState } from "react";
const workerHandler = (fn) => {
onmessage = (event) => {
postMessage(fn(event.data));
};
};
export const useWebworker = (fn) => {
name flag currency phone_code ISO2 ISO3 capital region flag_svg
Afghanistan 🇦🇫 AFN +93 AF AFG Kabul Asia https://restcountries.eu/data/afg.svg
Aland Islands 🇦🇽 EUR
Albania 🇦🇱 ALL +355 AL ALB Tirana Europe https://restcountries.eu/data/alb.svg
Algeria 🇩🇿 DZD +213 DZ DZA Algiers Africa https://restcountries.eu/data/dza.svg
American Samoa 🇦🇸 USD AS ASM Pago Pago Oceania https://restcountries.eu/data/asm.svg
Andorra 🇦🇩 EUR +376 AD AND Andorra la Vella Europe https://restcountries.eu/data/and.svg
Angola 🇦🇴 AOA +244 AO AGO Luanda Africa https://restcountries.eu/data/ago.svg
Anguilla 🇦🇮 XCD +1 264 AI AIA The Valley Americas https://restcountries.eu/data/aia.svg
Antarctica 🇦🇶 AQ ATA Polar https://restcountries.eu/data/ata.svg
@mityabeldii
mityabeldii / snippets.json
Last active February 12, 2021 11:23
javascript snippets for vs code
{
"console log": {
"prefix": "cl",
"body": [
"console.log($0);",
],
},
"media query": {
"prefix": "media",
"body": [
var restify = require('restify');
var CookieParser = require('restify-cookies');
var corsMiddleware = require('restify-cors-middleware');
var server = restify.createServer({ maxParamLength: 500 });
var REST_PORT = 8080
server.use(restify.plugins.bodyParser());
server.use(CookieParser.parse);
var cors = corsMiddleware({
/*eslint-disable no-unused-vars*/
import React from 'react';
class ComponentName extends React.Component {
static defaultProps = {
componentName: `componentName`
}
state = {
Счастье - это когда тебя понимают.
// $(".double_your_btc_link").click();
// $("#auto_bet_on").click();
input = document.getElementsByClassName("remove_autobet_error ")
checkbox = document.getElementsByClassName("big_checkbox")
input.autobet_max_bet.value = "0.00000512";
input.autobet_roll_count.value = "1000000";
input.stop_after_profit_value.value = "0.00000100";
input.autobet_lose_increase_bet_percent.value = "100";
//v
<View style={{width: window.width, height: window.height, backgroundColor: 'red', borderRadius: mvConsts.littleRadius, alignItems: 'center', justifyContent: 'center', }}>
$View$
</View>
//t
<Text style={{fontFamily: mvConsts.fonts.regular, fontSize: mvConsts.fontSizeMiddle, color: mvConsts.colors.fontColorMain, }} >
$text$
</Text>