Skip to content

Instantly share code, notes, and snippets.

View skvarovski's full-sized avatar
🌴
On vacation

Mike Skvarovski skvarovski

🌴
On vacation
  • Moscow
View GitHub Profile
@varunon9
varunon9 / AlwaysRunningAndroidService.md
Last active April 11, 2024 18:45
How to create an always running service in Android

Full Source Code: https://github.com/varunon9/DynamicWallpaper/tree/always_running_service

Steps-

  1. Create a Foreground Service (MyService.java)
  2. Create a Manifest registered Broadcast Receiver (MyReceiver.java) which will start your Foreground Service
  3. In onDestroy lifecycle of MyService, send a broadcast intent to MyReceiver
  4. Launch the MyService on app start from MainActivity (see step 8)
  5. With above 4 steps, MyService will always get re-started when killed as long as onDestroy of Service gets called
  6. onDestroy method of Service is not always guaranteed to be called and hence it might not get started again
@PlugFox
PlugFox / .proxyauth
Created May 15, 2019 10:29
Установка и настройка прокси-сервера 3proxy на Debian/Ubuntu
## addusers in this format:
#user:CL:password
##see for documentation: http://www.3proxy.ru/howtoe.asp#USERS
#
# Username
MyUser:CL:MyPassword
@thomascube
thomascube / image2grf.php
Created July 11, 2018 08:02
PHP function to convert a PNG image to a .GRF file for use with Zebra printers
<?php
/**
* Converts a PNG image to a .GRF file for use with Zebra printers
*
* The input is preferably a 1-bit black/white image but RGB images
* are accepted as well.
*
* This function uses PHP's GD library image functions.
*
/*
IoT Manager mqtt device client https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager
Based on Basic MQTT example with Authentication
PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient
- connects to an MQTT server, providing userdescr and password
- publishes config to the topic "/IoTmanager/config/deviceID/"
- subscribes to the topic "/IoTmanager/hello" ("hello" messages from mobile device)
Tested with Arduino IDE 1.6.6 + ESP8266 Community Edition v 2.0.0-stable and PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient
ESP8266 Community Edition v 2.0.0-stable have some HTTPS issues. Push notification temporary disabled.