How to create a JSON Web Token (JWT) in Javascript?
A Pen by Jonathan Petitcolas on CodePen.
<?php | |
if ('POST' !== $_SERVER['REQUEST_METHOD']) { | |
http_response_code(405); | |
exit( json_encode([ 'Client Error 405' => 'Method not allowed!' ]) ); | |
} | |
try { |
let promisedData = function() { | |
let deferredQuery = $.Deferred(); | |
$.ajax({ | |
type: "GET", | |
crossDomain: true, | |
dataType: "json", | |
cache: false, | |
data: "data=data", |
Why there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause? | |
in MySQL 5.6.5 (2012-04-10, Milestone 8) is possible to have 2 fields, as follows: | |
CREATE TABLE `foo` ( | |
`id` INT(10) UNSIGNED NOT NULL, | |
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`updated_at ` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | |
) ENGINE=INNODB; |
# Allow with + or - listing folder's content | |
Options +Indexes | |
##enable CORS and credentials | |
<IfModule mod_headers.c> | |
Header set Access-Control-Allow-Origin "*" | |
Header set Access-Control-Allow-Origin http://www.vknyvz.com | |
Header set Access-Control-Allow-Credentials true | |
</IfModule> |
<?php | |
$curl = curl_init(); | |
$url = 'http://localhost:6969/ws/'; | |
$opts = [ | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_CUSTOMREQUEST => "POST", |
try{ | |
Dropzone.autoDiscover = false; | |
const fileTypesWhiteList = "jpeg|jpg|gif|png|bmp|pdf|doc|docx|txt|odt"; | |
let dropZoneFileUploader = new Dropzone("#dz-custom-file-upload-form",{ | |
autoDiscover: false, | |
autoProcessQueue:false, | |
uploadMultiple: true, |
How to create a JSON Web Token (JWT) in Javascript?
A Pen by Jonathan Petitcolas on CodePen.
/* Polyfill indexOf. */ | |
var indexOf; | |
if (typeof Array.prototype.indexOf === 'function') { | |
indexOf = function (haystack, needle) { | |
return haystack.indexOf(needle); | |
}; | |
} else { | |
indexOf = function (haystack, needle) { | |
var i = 0, length = haystack.length, idx = -1, found = false; |
#!/bin/bash | |
## extracted from https://askubuntu.com/questions/976145/shell-script-to-clone-every-repo-of-a-github-organization | |
## original author is in the post, all credits goes to him/her/it | |
for i in $(curl "https://api.github.com/orgs/[organization]/repos?access_token=[access_token]" | sed '/[ ]*"clone_url":/!d;s/[^:]*: "//;s/",$//'); do | |
echo git clone $i | |
done |
#!/bin/bash | |
# EN - GIT AAPT stands for update the whole danm thing | |
# PT-BR - GIT AAPT significa Atualiza a porra toda | |
# | |
REPOSITORIES="$( cd /home/${USER}/public_html/ && pwd )" | |
IFS=$'\n' | |
for REPO in `ls "$REPOSITORIES/"` | |
do |