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
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:
| 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)); |
| 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)); |
| 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; |
| # In this example we're sending some test bitcoins from an address we control to a brand new test | |
| # address. We'll be sending the coins using the following address, public and private keys (please | |
| # don't abuse). | |
| # address : mtWg6ccLiZWw2Et7E5UqmHsYgrAi5wqiov | |
| # public : 03bb318b00de944086fad67ab78a832eb1bf26916053ecd3b14a3f48f9fbe0821f | |
| # private : 1af97b1f428ac89b7d35323ea7a68aba8cad178a04eddbbf591f65671bae48a2 | |
| # 1. generate a one-shot dummy address we're going to send money to | |
| $ curl -X POST http://api.blockcypher.com/v1/btc/test3/addrs | |
| { |
| const Web3 = require('web3') | |
| const Tx = require('ethereumjs-tx') | |
| // 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 privKey = 'PRIVATE_KEY' |
| [{ | |
| "address":"0x59416A25628A76b4730eC51486114c32E0B582A1", | |
| "symbol":"☀️ PLASMA", | |
| "decimal":6, | |
| "type":"default" | |
| },{ | |
| "address":"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7", | |
| "symbol":"1ST", | |
| "decimal":18, | |
| "type":"default" |
| import java.math.BigInteger; | |
| import java.nio.charset.Charset; | |
| import java.security.MessageDigest; | |
| import java.util.Random; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import org.apache.commons.codec.binary.Base64; |
| echo-server-epoll | |
| echo-server-poll | |
| talk | |
| talk.dSYM |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |