Skip to content

Instantly share code, notes, and snippets.

View PinkiNice's full-sized avatar
⛩️
The moon is only bright cause it reflects the sun's shine

Goshan Goshanov PinkiNice

⛩️
The moon is only bright cause it reflects the sun's shine
View GitHub Profile
@PinkiNice
PinkiNice / media.tsx
Last active March 7, 2024 14:31
Media Queries for CSS-in-JS + Rect
import { CSSPropertiesWithMultiValues } from '@emotion/serialize';
import React, { PropsWithChildren, useEffect, useState } from 'react';
type ScreenSize = 'xs' | 'sm' | 'md' | 'lg';
const screenSize = {
xs: 0,
sm: 576,
md: 768,
lg: 992,
@PinkiNice
PinkiNice / evm-chains.json
Last active April 25, 2023 10:27
All EVM compatible chains data in shortened JSON format
{
"ETH_mainnet": {
"name": "ELA-DID-Sidechain Mainnet",
"chain": "ETH",
"network": "mainnet",
"chainId": 22,
"networkId": 22
},
"EXP_mainnet": {
"name": "Expanse Network",
@PinkiNice
PinkiNice / babel.config.js
Created August 25, 2021 13:35
Babel with effector/babel-plugin config
module.exports = (api) => {
const mode = process.env.NODE_ENV ?? 'production';
// This caches the Babel config by environment.
api.cache.using(() => mode);
return {
presets: [
[
'@babel/preset-env',
@PinkiNice
PinkiNice / colors.scss
Last active March 26, 2021 09:29
SCSS css-variable app theming
// This gist allows you to setup simple color management through CSS variables.
$colors: (
// NewUi / Back_dark `#161620`
'bgPrimary': '22, 22, 32',
// NewUi / Back_blue `#23232F`
'bgSecondary': '35, 35, 47',
// Background / new `#262740`
'bgCosmic': '38, 39, 64',
// NewUI / white `#FFFFFF`
'textPrimary': '255, 255, 255',
@PinkiNice
PinkiNice / syncRequests.js
Created February 6, 2019 14:55
Wrapper for sending requests 1 by 1
/*
@Params:
action: Promise
*/
const syncRequests = function(action) {
let req = null;
let requestInProcess = false;
return (...params) => {
if (requestInProcess) {
@PinkiNice
PinkiNice / bindingSlots.js
Created January 23, 2019 13:55
Pass slots to child component Vue.js
//https://github.com/vuejs/vue/pull/7765#issuecomment-401985464
Vue.prototype._b = (function(bind) {
return function(data, tag, value, asProp, isSync) {
if (value && value.$scopedSlots) {
data.scopedSlots = value.$scopedSlots;
delete value.$scopedSlots;
}
return bind.apply(this, arguments);
};
@PinkiNice
PinkiNice / isRouteMatching.js
Last active February 25, 2019 12:21
Function to manually, programmatically compare active route to some other
const START = '/';
const trailingSlashRE = /\/?$/;
function isObjectEqual (a, b) {
if ( a === void 0 ) a = {};
if ( b === void 0 ) b = {};
// handle null value #1566
if (!a || !b) { return a === b }
var aKeys = Object.keys(a);