Skip to content

Instantly share code, notes, and snippets.

Avatar

Timoschenko Viacheslau ch3ll0v3k

View GitHub Profile
View MPU6050.cpp
/*
MPU6050 Triple Axis Gyroscope & Accelerometer. Simple Accelerometer Example.
Read more: http://www.jarzebski.pl/arduino/czujniki-i-sensory/3-osiowy-zyroskop-i-akcelerometr-mpu6050.html
GIT: https://github.com/jarzebski/Arduino-MPU6050
Web: http://www.jarzebski.pl
(c) 2014 by Korneliusz Jarzebski
*/
#include <Wire.h>
#include <MPU6050.h>
@ch3ll0v3k
ch3ll0v3k / README.md
Created Jul 21, 2020 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server
View README.md

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
View menu.jsx
import React, { Component } from "react";
import {
Text,
TouchableOpacity,
View,
Image,
ScrollView,
Button,
ImageBackground,
AppState,
View leaflet.tails-within.rect.js
function getTileUrls(bounds, tileLayer, zoom) {
var min = map.project(bounds.getNorthWest(), zoom).divideBy(256).floor(),
max = map.project(bounds.getSouthEast(), zoom).divideBy(256).floor(),
urls = [];
for (var i = min.x; i <= max.x; i++) {
for (var j = min.y; j <= max.y; j++) {
var coords = new L.Point(i, j);
coords.z = zoom;
urls.push(tileLayer.getTileUrl(coords));
View leaflet.tails-within.rect.js
function getTileUrls(bounds, tileLayer, zoom) {
var min = map.project(bounds.getNorthWest(), zoom).divideBy(256).floor(),
max = map.project(bounds.getSouthEast(), zoom).divideBy(256).floor(),
urls = [];
for (var i = min.x; i <= max.x; i++) {
for (var j = min.y; j <= max.y; j++) {
var coords = new L.Point(i, j);
coords.z = zoom;
urls.push(tileLayer.getTileUrl(coords));
View byte-color.to.heat-map.value.js
function getHSLColor( val ){
// normalize
val = (+val)>255?255:(+val)< 0?0:(+val);
// NON-STANDARD
// val = ((+val)-250) /285 - 320;
// h = (1 - (+val)) * 280;
// s = 100;
// l = (+val) * 50;
// l = 50;
View main.simple.2.py
# pip install pillow opencv-python opencv-contrib-python
import os
import sys
import cv2
from PIL import Image
from time import sleep
import urllib.request
import requests
View main.simple.py
# pip install pillow opencv-python opencv-contrib-python
import os
import sys
import cv2
from PIL import Image
video_name = 'myVideo.avi';
image_folder = './images'; # C:\\Python\\MyDirectory
fps = 10;
View nodejs.10+.RSA.js
const path = require('path');
const fs = require('fs');
const crypto = require('crypto');
const logger = require('mii-logger.js');
const RSA_BITS = 2048 * 2;
const LOCATION = __dirname+'/rsa_keys';
const SEC_KEY = 'sec_key.pem';
const PUB_KEY = 'pub_key.pem';
View test.js
CVTResMessage: function( inp ){
switch( inp ){
case 'address must be valid': return 'At least one address supplied in the request was invalid. Addresses are validated before processing a request. If validation fails, an error containing this message is returned. ';
case 'FAILURE_SERVER_LIMIT': return 'The number of accounts that are allowed to harvest on NIS was exceeded.';
case 'FAILURE_UNKNOWN_ACCOUNT': return 'The account specified in the request is not known.';
case 'FAILURE_PAST_DEADLINE': return 'The deadline for the entity has already expired. The deadline must always lie in the future.';
case 'FAILURE_FUTURE_DEADLINE': return 'The deadline lies too far in the future. Deadlines are only allowed to lie up to 24 hours in the future.';
case 'FAILURE_INSUFFICIENT_BALANCE': return 'The account does not have enough funds.';