Skip to content

Instantly share code, notes, and snippets.

View okovalov's full-sized avatar
🏠
Working from home

Oleksandr Kovalov okovalov

🏠
Working from home
View GitHub Profile
@okovalov
okovalov / README.md
Created September 9, 2023 03:33 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@okovalov
okovalov / wasm_sync.fish
Created January 20, 2022 00:27
Build three types of wasm from the wasm component of the platform and sync it to the sdk
function wasm_sync -d "Compile wasm from platform, and cody to findora-wallet-wasm "
set original_directory $PWD
set -l findoraDir "$OLEKS_ROOT/prj/Findora"
set -l wasmComponentDir "$findoraDir/platform/src/components/wasm"
set -l sourceDir "$wasmComponentDir/pkg"
set -l wasmTargetRootDir "$findoraDir/findora-wallet-wasm"
echo
@okovalov
okovalov / foo.md
Last active September 28, 2021 21:55
SSH key for github acoount

this is foo

@okovalov
okovalov / remove-node-modules.md
Created September 26, 2021 21:56 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo

How to remove node_modules

  1. Create a .gitignore file in the git repository if it does not contain one

touch .gitignore

  1. Open up the .gitignore and add the following line to the file

**/node_modules

@okovalov
okovalov / index.js
Last active July 17, 2020 16:21
ECMAScript 6 sets: union, intersection, difference
// ECMAScript 6 sets: union, intersection, difference
// 1 union
let a = new Set([1,2,3]);
let b = new Set([4,3,2]);
let union = new Set([...a, ...b]); // {1,2,3,4}
// 2 intersection
let a = new Set([1,2,3]);
let b = new Set([4,3,2]);
@okovalov
okovalov / index.js
Last active July 13, 2020 16:36
How to use cusrtom events
// In JavaScript we can create custom events, and the way it works changes in the
// browser and in Node.js.
// In the frontend we use the Event object which is provided by the browser:
const anEvent = new Event('start');
// You can trigger the event using
document.dispatchEvent(anEvent)
@okovalov
okovalov / index.js
Last active July 13, 2020 16:30
How to create a custom JS Error
class OutOfFuelError extends Error {
constructor(message) {
super(message)
this.name = "OutOfFuelError"
}
}
class FlatTireError extends Error {}
try {
@okovalov
okovalov / tab.bash
Created July 7, 2020 14:58 — forked from bobthecow/tab.bash
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
const shuffle = arr => arr.sort(() => Math.random() - 0.5)
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9]
console.log('Data 1', data)
console.log('Data 2', shuffle(data))
console.log('Data 3', shuffle(data))
console.log('Data 4', shuffle(data))
console.log('Data 5', shuffle(data))
{
"scripts": [],
"showConsole": true,
"scriptType": "module"
}