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
// Add the progress output div to the top of the body | |
const progressOutputDiv = document.createElement('div'); | |
progressOutputDiv.id = 'progress-output'; | |
document.body.insertBefore(progressOutputDiv, document.body.firstChild); | |
// Add CSS to position the output div to the right | |
const style = document.createElement('style'); | |
style.innerHTML = ` | |
#progress-output { | |
margin-left: auto; |
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
#Reference: https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/ | |
To request an SSL certificate from a CA like Verisign or GoDaddy, you send them a Certificate Signing Request (CSR), and they give you an SSL certificate in return that they have signed using their root certificate and private key. All browsers have a copy (or access to a copy from the operating system) of the root certificate from the various CAs, so the browser can verify that your certificate was signed by a trusted CA. | |
That’s why when you generate a self-signed certificate the browser doesn’t trust it. It hasn’t been signed by a CA. The way to get around this is to generate our own root certificate and private key. We then add the root certificate to all the devices we own just once, and then all the self-signed certificates we generate will be inherently trusted. | |
# Generating the Private Key and Root Certificate | |
brew install openssl | |
mkdir ~/certs | |
cd ~/certs |
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
version: '3' | |
services: | |
db: | |
image: mysql:8.0 | |
container_name: test_db | |
restart: "no" | |
ports: | |
- "33006:3306" | |
environment: |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Server-sent events demo</title> | |
</head> | |
<body> | |
<button>Close the connection</button> | |
<ul> | |
</ul> |
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
import os | |
from os import listdir | |
from os.path import isfile, join | |
from shutil import copy2 | |
if __name__ == '__main__': | |
mypath = u'C:\\Users\\Onur\\Downloads\\Twitch Sesler-20200624T185904Z-001\\Twitch Sesler\\lowercase' | |
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))] | |
# try: |
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
db.getCollection("LOG_Android_Voided_Purchases").aggregate( | |
[ | |
{ | |
"$match" : { | |
"voidedTime" : { | |
"$gte" : ISODate("2020-06-10T00:00:00.000+0000") | |
} | |
} | |
}, | |
{ |
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 | |
/*db connectors*/ | |
include('dbconfig.php'); | |
/*function to set your files*/ | |
function output_file($file, $name, $mime_type='') | |
{ | |
if(!is_readable($file)) die('File not found or inaccessible!'); | |
$size = filesize($file); | |
$name = rawurldecode($name); |
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
##########TCP SERVER ####################### | |
#If you are already familiar with django, and your microcontroller supports sending HTTP (REST) requests and can parse Json , you can just add a regular django based view that returns json: | |
# views.py | |
from django.http import JsonResponse | |
def my_view(request): | |
# handle input here, probably using request.GET / request.POST | |
return JsonResponse({'status': 'OK'}) | |
#However, if your microcontroller is very simple and cannot do HTTP/json, you can use a simple SocketServer from python's standard library instead: |
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
$( ".container" ) | |
.contents() | |
.filter(function() { | |
return this.nodeType === 3; | |
}) | |
.wrap( "<p></p>" ) | |
.end() | |
.filter( "br" ) | |
.remove(); |
NewerOlder