Skip to content

Instantly share code, notes, and snippets.

Avatar
🐋

Anton Vlasov whalemare

🐋
View GitHub Profile
@whalemare
whalemare / quokka.ts
Created Apr 2, 2021
Realtime phone number format with libphonenumber
View quokka.ts
import pjs, {AsYouType} from 'libphonenumber-js'
const typeRu = new AsYouType("RU")
const typeBy = new AsYouType("BY")
const typeUA = new AsYouType("UA")
const raws = [
'+79131234567', '89131234567', '9131234567', '79131234567', '9131234567',
// by
"+375292123456", "375292123456",
@whalemare
whalemare / farm-siege.scpt
Created Jan 19, 2021
Farm points in Siege PS4
View farm-siege.scpt
set O to 53
set X to 36
set keyUp to 126
set keyDown to 125
set keyLeft to 123
set keyRight to 124
set countRepeat to 0
set minOk to 15
View timezones.json
[
{
"zoneName": "Atlantic/Cape_Verde",
"offset": "-01:00"
},
{
"zoneName": "Brazil/DeNoronha",
"offset": "-02:00"
},
{
View setup.sh
# instal docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
sudo systemctl status docker
@whalemare
whalemare / emulators.sh
Created Dec 26, 2019
Run Android emulator from command line
View emulators.sh
#! /bin/bash
# This script helped to you start emulator from cli
# Check if the emulator command exists first
if ! type emulator > /dev/null; then
export PATH=${PATH}:~/Library/Android/sdk/emulator
fi
if ! type emulator > /dev/null; then
View gist:f65b758f02e837d14fb85458a5716f13
firebase functions:config:set service_account="$(cat service-account.json)"
https://github.com/firebase/firebase-tools/issues/406#issuecomment-353017349
View Main.kt
/**
* @since 2019
* @author Anton Vlasov - whalemare
*/
class Main {
fun main(args: Array<String>) {
logger("hello")
}
}
View keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+q",
"command": "editor.action.showHover",
"when": "editorTextFocus"
},
{
"key": "cmd+w",
"command": "editor.action.smartSelect.expand",
@whalemare
whalemare / eslint-install.sh
Last active Aug 29, 2019
Fast install ESLint and Prettier
View eslint-install.sh
#!/bin/bash
file="package.json"
if [ -f "$file" ]
then
# all is ok
echo ""
else
cd ..
if [ -f "$file" ]
@whalemare
whalemare / index.js
Created Jul 15, 2019
Simple .sortBy implementation for JS
View index.js
function compare(x, y) {
return x > y
}
/**
* @param {any[]} array list of items
* @param {() => boolean} f function selector
*/
function sortBy(array, f) {
return array.sort((x, y) => compare(f(x), f(y)))