feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

10
Skills/@be/be/node_modules/axios/examples/README.md generated vendored Normal file
View File

@@ -0,0 +1,10 @@
# axios examples
To run the examples:
1. `git clone https://github.com/axios/axios.git`
2. `cd axios`
3. `npm install`
4. `grunt build`
5. `npm run examples`
6. [http://localhost:3000](http://localhost:3000)

View File

@@ -0,0 +1,44 @@
<!doctype html>
<html>
<head>
<title>axios - all example</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>axios.all</h1>
<div>
<h3>User</h3>
<div class="row">
<img id="useravatar" src="" class="col-md-1"/>
<div class="col-md-3">
<strong id="username"></strong>
</div>
</div>
<hr/>
<h3>Orgs</h3>
<ul id="orgs" class="list-unstyled"></ul>
</div>
<script src="/axios.min.js"></script>
<script>
axios.all([
axios.get('https://api.github.com/users/mzabriskie'),
axios.get('https://api.github.com/users/mzabriskie/orgs')
]).then(axios.spread(function (user, orgs) {
document.getElementById('useravatar').src = user.data.avatar_url;
document.getElementById('username').innerHTML = user.data.name;
document.getElementById('orgs').innerHTML = orgs.data.map(function (org) {
return (
'<li class="row">' +
'<img src="' + org.avatar_url + '" class="col-md-1"/>' +
'<div class="col-md-3">' +
'<strong>' + org.login + '</strong>' +
'</div>' +
'</li>'
);
}).join('');
}));
</script>
</body>
</html>

View File

@@ -0,0 +1,37 @@
<!doctype html>
<html>
<head>
<title>AMD</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>AMD</h1>
<div>
<h3>User</h3>
<div class="row">
<img id="useravatar" src="" class="col-md-1"/>
<div class="col-md-3">
<strong id="username"></strong>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.16/require.min.js"></script>
<script>
requirejs.config({
paths: {
axios: '/axios.min'
}
});
requirejs(['axios'], function (axios) {
axios.get('https://api.github.com/users/mzabriskie')
.then(function (user) {
document.getElementById('useravatar').src = user.data.avatar_url;
document.getElementById('username').innerHTML = user.data.name;
});
});
</script>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!doctype html>
<html>
<head>
<title>axios - get example</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>axios.get</h1>
<ul id="people" class="list-unstyled"></ul>
<script src="/axios.min.js"></script>
<script>
axios.get('/get/server')
.then(function (response) {
document.getElementById('people').innerHTML = response.data.map(function (person) {
return (
'<li class="row">' +
'<img src="https://avatars.githubusercontent.com/u/' + person.avatar + '?s=50" class="col-md-1"/>' +
'<div class="col-md-3">' +
'<strong>' + person.name + '</strong>' +
'<div>Github: <a href="https://github.com/' + person.github + '" target="_blank">' + person.github + '</a></div>' +
'<div>Twitter: <a href="https://twitter.com/' + person.twitter + '" target="_blank">' + person.twitter + '</a></div>' +
'</div>' +
'</li><br/>'
);
}).join('');
})
.catch(function (err) {
document.getElementById('people').innerHTML = '<li class="text-danger">' + err.message + '</li>';
});
</script>
</body>
</html>

View File

@@ -0,0 +1,34 @@
var people = [
{
"name": "Matt Zabriskie",
"github": "mzabriskie",
"twitter": "mzabriskie",
"avatar": "199035"
},
{
"name": "Ryan Florence",
"github": "rpflorence",
"twitter": "ryanflorence",
"avatar": "100200"
},
{
"name": "Kent C. Dodds",
"github": "kentcdodds",
"twitter": "kentcdodds",
"avatar": "1500684"
},
{
"name": "Chris Esplin",
"github": "deltaepsilon",
"twitter": "chrisesplin",
"avatar": "878947"
}
];
module.exports = function (req, res) {
res.writeHead(200, {
'Content-Type': 'text/json'
});
res.write(JSON.stringify(people));
res.end();
};

View File

@@ -0,0 +1,40 @@
<!doctype html>
<html>
<head>
<title>axios - post example</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>axios.post</h1>
<form role="form" class="form" onsubmit="return false;">
<div class="form-group">
<label for="data">JSON</label>
<textarea id="data" class="form-control" rows="5"></textarea>
</div>
<button id="post" type="button" class="btn btn-primary">POST</button>
</form>
<div id="output" class="container"></div>
<script src="/axios.min.js"></script>
<script>
(function () {
var output = document.getElementById('output');
document.getElementById('post').onclick = function () {
var data = document.getElementById('data').value;
axios.post('/post/server', JSON.parse(data))
.then(function (res) {
output.className = 'container';
output.innerHTML = res.data;
})
.catch(function (err) {
output.className = 'container text-danger';
output.innerHTML = err.message;
});
};
})();
</script>
</body>
</html>

View File

@@ -0,0 +1,16 @@
module.exports = function (req, res) {
var data = '';
req.on('data', function (chunk) {
data += chunk;
});
req.on('end', function () {
console.log('POST data received');
res.writeHead(200, {
'Content-Type': 'text/json'
});
res.write(JSON.stringify(data));
res.end();
});
};

137
Skills/@be/be/node_modules/axios/examples/server.js generated vendored Normal file
View File

@@ -0,0 +1,137 @@
var fs = require('fs');
var url = require('url');
var path = require('path');
var http = require('http');
var argv = require('minimist')(process.argv.slice(2));
var server;
var dirs;
function listDirs(root) {
var files = fs.readdirSync(root);
var dirs = [];
for (var i=0, l=files.length; i<l; i++) {
var file = files[i];
if (file[0] !== '.') {
var stat = fs.statSync(path.join(root, file));
if (stat.isDirectory()) {
dirs.push(file);
}
}
}
return dirs;
}
function getIndexTemplate() {
var links = dirs.map(function (dir) {
var url = '/' + dir;
return '<li onclick="document.location=\'' + url + '\'"><a href="' + url + '">' + url + '</a></li>';
});
return (
'<!doctype html>' +
'<html>' +
'<head>' +
'<title>axios examples</title>' +
'<style>' +
'body {padding:25px;}' +
'ul {margin:0; padding:0; list-style:none;}' +
'li {padding:5px 10px;}' +
'li:hover {background:#eee; cursor:pointer;}' +
'a {text-decoration:none; color:#0080ff;}' +
'</style>' +
'<body>' +
'<ul>' +
links.join('') +
'</ul>'
);
}
function sendResponse(res, statusCode, body) {
res.writeHead(statusCode);
res.write(body);
res.end();
}
function send200(res, body) {
sendResponse(res, 200, body || '<h1>OK</h1>');
}
function send404(res, body) {
sendResponse(res, 404, body || '<h1>Not Found</h1>');
}
function pipeFileToResponse(res, file, type) {
if (type) {
res.writeHead(200, {
'Content-Type': type
});
}
fs.createReadStream(path.join(__dirname, file)).pipe(res);
}
dirs = listDirs(__dirname);
server = http.createServer(function (req, res) {
var url = req.url;
// Process axios itself
if (/axios\.min\.js$/.test(url)) {
pipeFileToResponse(res, '../dist/axios.min.js', 'text/javascript');
return;
}
if (/axios\.min\.map$/.test(url)) {
pipeFileToResponse(res, '../dist/axios.min.map', 'text/javascript');
return;
}
if (/axios\.amd\.min\.js$/.test(url)) {
pipeFileToResponse(res, '../dist/axios.amd.min.js', 'text/javascript');
return;
}
if (/axios\.amd\.min\.map$/.test(url)) {
pipeFileToResponse(res, '../dist/axios.amd.min.map', 'text/javascript');
return;
}
// Process /
if (url === '/' || url === '/index.html') {
send200(res, getIndexTemplate());
return;
}
// Format request */ -> */index.html
if (/\/$/.test(url)) {
url += 'index.html';
}
// Format request /get -> /get/index.html
var parts = url.split('/');
if (dirs.indexOf(parts[parts.length - 1]) > -1) {
url += '/index.html';
}
// Process index.html request
if (/index\.html$/.test(url)) {
if (fs.existsSync(path.join(__dirname, url))) {
pipeFileToResponse(res, url, 'text/html');
} else {
send404(res);
}
}
// Process server request
else if (new RegExp('(' + dirs.join('|') + ')\/server').test(url)) {
if (fs.existsSync(path.join(__dirname, url + '.js'))) {
require(path.join(__dirname, url + '.js'))(req, res);
} else {
send404(res);
}
}
else {
send404(res);
}
});
server.listen(argv.p || 3000);

View File

@@ -0,0 +1,44 @@
<!doctype html>
<html>
<head>
<title>axios - transform response example</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>transformResponse</h1>
<div class="row">
<img id="useravatar" src="" class="col-md-1"/>
<div class="col-md-3">
<strong id="username"></strong><br/>
Created: <span id="created"></span><br/>
Updated: <span id="updated"></span>
</div>
</div>
<script src="/axios.min.js"></script>
<script>
var ISO_8601 = /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})Z/;
function formatDate(d) {
return (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear();
}
axios.get('https://api.github.com/users/mzabriskie', {
transformResponse: axios.defaults.transformResponse.concat(function (data, headers) {
Object.keys(data).forEach(function (k) {
if (ISO_8601.test(data[k])) {
data[k] = new Date(Date.parse(data[k]));
}
});
return data;
})
})
.then(function (res) {
document.getElementById('useravatar').src = res.data.avatar_url;
document.getElementById('username').innerHTML = res.data.name;
document.getElementById('created').innerHTML = formatDate(res.data.created_at);
document.getElementById('updated').innerHTML = formatDate(res.data.updated_at);
});
</script>
</body>
</html>

View File

@@ -0,0 +1,48 @@
<!doctype html>
<html>
<head>
<title>axios - file upload example</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
</head>
<body class="container">
<h1>file upload</h1>
<form role="form" class="form" onsubmit="return false;">
<div class="form-group">
<label for="file">File</label>
<input id="file" type="file" class="form-control"/>
</div>
<button id="upload" type="button" class="btn btn-primary">Upload</button>
</form>
<div id="output" class="container"></div>
<script src="/axios.min.js"></script>
<script>
(function () {
var output = document.getElementById('output');
document.getElementById('upload').onclick = function () {
var data = new FormData();
data.append('foo', 'bar');
data.append('file', document.getElementById('file').files[0]);
var config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round( (progressEvent.loaded * 100) / progressEvent.total );
}
};
axios.put('/upload/server', data, config)
.then(function (res) {
output.className = 'container';
output.innerHTML = res.data;
})
.catch(function (err) {
output.className = 'container text-danger';
output.innerHTML = err.message;
});
};
})();
</script>
</body>
</html>

View File

@@ -0,0 +1,13 @@
module.exports = function (req, res) {
var data = '';
req.on('data', function (chunk) {
data += chunk;
});
req.on('end', function () {
console.log('File uploaded');
res.writeHead(200);
res.end();
});
};