Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
if (process.version.startsWith("v6")) throw new Error("This Bot requires Node 7v+ because of async/await") | |
const Discord = require("discord.js") | |
const express = require("express") | |
const app = express() | |
const superagent = require("superagent") | |
//Config | |
let INVITE = process.env.INVITE || "", //An Infinite Invite to your discord server. | |
GUILD = process.env.GUILD || "", //The ID of the Guild for this invite ^ |
@echo off | |
setlocal | |
call :setESC | |
cls | |
echo %ESC%[101;93m STYLES %ESC%[0m | |
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m | |
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m | |
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m |
#!/bin/sh | |
# | |
# A hook script to remove BOM headers | |
echo "Running pre-commit BOM removal" | |
trap ctrl_c INT | |
ctrl_c () | |
{ |
/** | |
* jQuery 2.1.3's parseHTML (without scripts options). | |
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM. | |
* MIT license. | |
* | |
* If you only support Edge 13+ then try this: | |
function parseHTML(html, context) { | |
var t = (context || document).createElement('template'); | |
t.innerHTML = html; | |
return t.content; |
/* | |
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
*/ | |
var fs = require('fs'); | |
// string generated by canvas.toDataURL() | |
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
+ "3gAAAABJRU5ErkJggg=="; | |
// strip off the data: url prefix to get just the base64-encoded bytes |
// Load data tiles from an AJAX data source | |
L.TileLayer.Ajax = L.TileLayer.extend({ | |
_requests: [], | |
_addTile: function (tilePoint) { | |
var tile = { datum: null, processed: false }; | |
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile; | |
this._loadTile(tile, tilePoint); | |
}, | |
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile | |
_xhrHandler: function (req, layer, tile, tilePoint) { |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
#!/bin/bash | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
# From ffmpeg -codecs > codecs.txt | |
Codecs: | |
D..... = Decoding supported | |
.E.... = Encoding supported | |
..V... = Video codec | |
..A... = Audio codec | |
..S... = Subtitle codec | |
...S.. = Supports draw_horiz_band |