Skip to content

Instantly share code, notes, and snippets.

@Awesome-T
Awesome-T / messages.g.proto
Last active April 1, 2024 14:21
Example of using `d2p_gen` package.
syntax = "proto3";
package messages;
option java_outer_classname = "MessagesProto";
option java_multiple_files = true;
option java_generic_services = false;
option optimize_for = SPEED;
/*
class: Foo
@Awesome-T
Awesome-T / emulator-install-using-avdmanager.md
Created January 9, 2024 18:23 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@Awesome-T
Awesome-T / wsl2-ubuntu-map-win-localhost.sh
Created June 7, 2022 18:15 — forked from toryano0820/wsl2-ubuntu-map-win-localhost.sh
For WSL2: Fixes "Connection Refused" issue when accessing Windows localhost services. Run with "sudo sh wsl2-ubuntu-map-win-localhost.sh" !!! Remember to backup "/etc/hosts" just in case !!!
nameserver=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}') # find nameserver
[ -n "$nameserver" ] || "unable to find nameserver" || exit 1 # exit immediately if nameserver was not found
echo "##### nameserver found: '$nameserver'"
localhost_entry=$(grep -v "127.0.0.1" /etc/hosts | grep "\slocalhost$") # find localhost entry excluding 127.0.0.1
if [ -n "$localhost_entry" ]; then # if localhost entry was found
echo "##### localhost entry found: '$localhost_entry'"
sed -i "s/$localhost_entry/$nameserver localhost/g" /etc/hosts # then update localhost entry with the new $nameserver
else # else if entry was not found
echo "##### localhost entry not found"
echo "$nameserver localhost" >> /etc/hosts # then append $nameserver mapping to localhost
@Awesome-T
Awesome-T / cp1251 request.dart
Created November 7, 2021 13:29 — forked from PlugFox/cp1251 request.dart
Flutter http.get и конвертация результата из Windows-1251 в UTF-8 с последующим разбором
// Список символов в кодировке Windows-1251
const List cp1251 = [
'\u0000',
'\u0001',
'\u0002',
'\u0003',
'\u0004',
'\u0005',
'\u0006',
'\u0007',
@Awesome-T
Awesome-T / country-code-to-currency-code-mapping.csv
Created January 8, 2021 09:57 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD