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
<script>alert(document.cookie)</script> |
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
/** | |
* cloudflare-worker-youtube-dl.js | |
* Get direct links to YouTube videos using Cloudflare Workers. | |
* | |
* Usage: | |
* GET /?v=dQw4w9WgXcQ | |
* -> Returns a JSON list of supported formats | |
* | |
* GET /?v=dQw4w9WgXcQ&f=251 | |
* -> Returns a stream of the specified format ID |
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
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/vim-easy-align' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'w0rp/ale' | |
Plug 'itchyny/lightline.vim' | |
Plug 'tpope/vim-surround' | |
Plug 'morhetz/gruvbox' | |
Plug 'pangloss/vim-javascript' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'chemzqm/vim-jsx-improve' |
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
create schema shard_1; | |
create sequence shard_1.global_id_sequence; | |
CREATE OR REPLACE FUNCTION shard_1.id_generator(OUT result bigint) AS $$ | |
DECLARE | |
our_epoch bigint := 1314220021721; | |
seq_id bigint; | |
now_millis bigint; | |
-- the id of this DB shard, must be set for each | |
-- schema shard you have - you could pass this as a parameter too |
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
© (C) | |
« << | |
- | |
® (R) | |
» >> | |
¼ 1/4 | |
½ 1/2 | |
¾ 3/4 | |
À A | |
Á A |
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
searchPost = value =>{ | |
clearTimeout(this.timeout) | |
this.timeout = setTimeout(() => { | |
if(value.length < 1) return | |
return console.log('begin search: ', value) | |
}, 500) | |
} |
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 | |
function require_auth() { | |
$AUTH_USER = 'admin'; | |
$AUTH_PASS = 'admin'; | |
header('Cache-Control: no-cache, must-revalidate, max-age=0'); | |
$has_supplied_credentials = !(empty($_SERVER['PHP_AUTH_USER']) && empty($_SERVER['PHP_AUTH_PW'])); | |
$is_not_authenticated = ( | |
!$has_supplied_credentials || | |
$_SERVER['PHP_AUTH_USER'] != $AUTH_USER || | |
$_SERVER['PHP_AUTH_PW'] != $AUTH_PASS |
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
function median(values) { | |
values.sort( function(a,b) {return a - b;} ); | |
var half = Math.floor(values.length/2); | |
if(values.length % 2) | |
return values[half]; | |
else | |
return (values[half-1] + values[half]) / 2.0; |
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
('0' + 11).slice(-2) // '11' | |
('0' + 4).slice(-2) // '04' | |
For ease of access, you could of course extract it to a function, or even extend Number with it: | |
Number.prototype.pad = function(n) { | |
return new Array(n).join('0').slice((n || 2) * -1) + this; | |
} | |
Which will allow you to write: | |
c += deg.pad() + '° '; // "04° " |
NewerOlder