This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On the basis: https://forum.unity.com/threads/export-obj-while-runtime.252262/ | |
// How to use: | |
// Put file to Assets/Editor folder | |
// then select GameObject -> Export selected objects | |
// in Unity's main panel. | |
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove containers | |
docker rm -f $(docker ps -a -q) | |
# Remove images | |
docker rmi -f $(docker images -a -q) | |
# Remove volumes | |
docker volume rm $(docker volume ls -q) | |
docker volume prune | |
docker system prune --volumes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: exclude (separate) 'notifyUser' property from 'request' object | |
const request = { | |
id: 1, | |
title: 'ID 1 title', | |
notifyUser: true | |
}; | |
const { notifyUser, ...updateSet } = request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getEnumKeyByValue = (enumerated, value: string) => { | |
return Object.keys(enumerated)[ | |
Object.values(enumerated).indexOf(value as typeof enumerated) | |
]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** For key/value enum: */ | |
export enum CountryEnum { | |
fra = 'FRANCE', | |
ukr = 'UKRAINE', | |
} | |
// ['FRANCE', 'UKRAINE'] | |
export const CountryList = Object.entries(CountryEnum).map( | |
([, value]) => value, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Send bombard requests to russian propaganda and infrastructure sites. | |
# | |
# Requirements: Docker, Python 2.7+, requests | |
# | |
# Check which pip version do you have: pip --version | |
# Then you need to install | |
# pip install requests | |
# OR | |
# sudo python3 -m pip install requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes any whitespace character. | |
* This includes tabs and newline characters, as well as | |
* multibyte whitespace such as the thin space and ideographic space, | |
* unprintable characters and invalid unicode characters. | |
* | |
* @param string $string | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert long integer number into abbreviated string. | |
* Fast approach without math functions usage. | |
* Integers up to 999 Uncentillions (1 Un = 1e306) are supported. | |
* | |
* getAbbreviatedNumber('1024'); // '1.02K' | |
* getAbbreviatedNumber('-123456', 3); // '-123.456K' | |
* getAbbreviatedNumber('1000000'); // '1M' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Book ID on loveread.ec | |
* For example, for | |
* http://loveread.ec/read_book.php?id=2555&p=1 | |
* ID is 2555. | |
* | |
* @param int $id | |
*/ | |
public function getFromLoveread(int $id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$num = getRandNumber(5); | |
var_dump($num); // 5-digits number like 48149 | |
/** | |
* Returns fixed-length random integer. | |
*/ | |
function getRandNumber(int $length): int |
NewerOlder