Skip to content

Instantly share code, notes, and snippets.

View ch3ll0v3k's full-sized avatar

Timoschenko Viacheslau ch3ll0v3k

View GitHub Profile
@jgdoncel
jgdoncel / fn_remove_accents.sql
Last active April 19, 2024 12:20
MySQL Function to remove accents and special characters
DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue COLLATE utf8_general_ci;;
-- ACCENTS
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ';
@raineorshine
raineorshine / sendRawTransaction.js
Last active December 3, 2022 18:02
Sends a raw transaction with web3 v1.2.2, ethereumjs-tx v2.1.1, and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx').Transaction
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privateKey = new Buffer('PRIVATE_KEY', 'hex')
@simonhlee97
simonhlee97 / vuejs.md
Last active February 21, 2019 01:20
Net Ninja's Vue.js Course

video #22: Props

in Vue.js, data gets passed down as a prop from one component to another.


video #23: Primitive vs Reference Types

primitive types are STRINGS, BOOLEANS, and NUMBERS reference types are OBJECTS and ARRAYS

@mrbar42
mrbar42 / README.md
Last active March 28, 2024 18:06
Secured HLS setup with Nginx as media server

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
//author @TraderX0
//script to plot daily Open high and low
//version 1.1
//last edited 22/11/2018
//title
study(title="TraderX0__O_H_L", shorttitle="TraderX0_O_H_L", overlay=true)
// holds the daily price levels
openPrice = security(tickerid, 'D', open)
const key = (x, y) => {
return x + ',' + y
}
const unkey = k => {
return k.split(',').map(s => parseInt(s))
}
/* Given an x, y coordinate and a hashmap "x,y" => boolean values that indicate whether or not the tile at that
coordinate is blocked, this function will calculate the bitmask sum of the given coordinate. */
function computeBitmask(x, y, blockedCells) {
@kekru
kekru / 01nginx-tls-sni.md
Last active April 1, 2024 02:29
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@shubhamwagh
shubhamwagh / TexturedMeshSteps.md
Last active April 24, 2024 14:26
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and
@stavros-k
stavros-k / 14ACN6-tlp1.4.md
Created August 21, 2021 22:41
TLP 1.4 Test: Battery Care for Lenovo IdeaPad 5 Pro (AMD) 14'' Gen 6

SYSTEM

LENOVO IdeaPad 5 Pro 14ACN6 82L7

Enable conservation

Edit /etc/tlp.conf

~$ cat /etc/tlp.conf | grep STOP_CHARGE_THRESH_BAT0
STOP_CHARGE_THRESH_BAT0="1"
@BlockmanCodes
BlockmanCodes / .env
Created April 10, 2022 19:23
Get spot prices on Uniswap
INFURA_URL=<your_url>
ETHERSCAN_API_KEY=<your_api_key>