Skip to content

Instantly share code, notes, and snippets.

View webprice's full-sized avatar
🕶️
I'm the greatest

Serhii Hrekov webprice

🕶️
I'm the greatest
View GitHub Profile
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎯</text></svg>">
import time
import random
import string
#generate random number, that will declare how many letters
#will be added to the text.txt file. Each time we change the text.txt file
#we can made a commit and push it to the reote repo
#which will be considered as a github contribution
x = random.randrange(10)
random_letter = random.choices(string.ascii_letters,k=x)
@webprice
webprice / arduino.h
Last active January 30, 2022 16:53
ddnames arduino example program to send the updated ip address of the device
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
const char* ssid = "YourSSID"; //your wifi SSID
const char* password = "YourWiFiPassword";
byte tries = 10;
// Trying to connect to wireless AP
@webprice
webprice / 1_register.py
Last active January 30, 2022 16:55
Python apps
#Register ddnames account
import pprint
import requests
#change email and password to yours data
email = "yourname@gmail.com"
password = "yourpassword"
dictToSend = {'email':email,'password': password}
res = requests.post('https://ddnames.com:8000/register', json=dictToSend)
print ('response from server:',res.status_code,":", res.text)
print("res,json",res.json())
#All further actions require the user data alongside with personalized bearer token in the header of the request!
# Dont forget to attach the personalized token to each further request, otherwise, you will be non-authorized and be unable to perform actions.
#Add your domain to ddnames database:
#Route: https://ddnames.com:8000/add
#request you should send within your device in JSON format:
{
"email":"YourEmail",
"ipaddress":"your device's ip address",
"apikey":"your api key",
@webprice
webprice / ddnames_non_authorized_actions.py
Last active January 30, 2022 16:46
You can start by registering your account by sending a simple JSON request:
#You can start by registering your account by sending a simple JSON request
#Route: https://ddnames.com:8000/register/
#request you should send within your device in JSON format:
{
"email":"YourEmail",
"password":"password"
}
#Don't forget to remember the API key, the system will generate it for you.