Job search and people-to-sql with Bun
This commit is contained in:
134
.vscode/launch.json
vendored
134
.vscode/launch.json
vendored
@ -1,56 +1,82 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Compare",
|
"name": "Compare",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Compare",
|
"preLaunchTask": "Build-Compare",
|
||||||
"program": "${workspaceFolder}/Compare/bin/Debug/net9.0/win-x64/AA.Compare.dll",
|
"program": "${workspaceFolder}/Compare/bin/Debug/net9.0/win-x64/AA.Compare.dll",
|
||||||
"args": [
|
"args": [
|
||||||
"s"
|
"s"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"requireExactSource": false
|
"requireExactSource": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Rename",
|
"name": "Rename",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Rename",
|
"preLaunchTask": "Build-Rename",
|
||||||
"program": "${workspaceFolder}/Rename/bin/Debug/net9.0/win-x64/AA.Rename.dll",
|
"program": "${workspaceFolder}/Rename/bin/Debug/net9.0/win-x64/AA.Rename.dll",
|
||||||
"args": [
|
"args": [
|
||||||
"s"
|
"s"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"requireExactSource": false
|
"requireExactSource": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Windows",
|
"name": "Windows",
|
||||||
"type": "coreclr",
|
"type": "coreclr",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"preLaunchTask": "Build-Windows",
|
"preLaunchTask": "Build-Windows",
|
||||||
"program": "${workspaceFolder}/Windows/bin/Debug/net9.0/win-x64/AA.Windows.dll",
|
"program": "${workspaceFolder}/Windows/bin/Debug/net9.0/win-x64/AA.Windows.dll",
|
||||||
"args": [
|
"args": [
|
||||||
"s"
|
"s"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"requireExactSource": false
|
"requireExactSource": false
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "node Launch Current Opened File",
|
||||||
|
"program": "${file}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bun",
|
||||||
|
"internalConsoleOptions": "neverOpen",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug File",
|
||||||
|
"program": "${file}",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"stopOnEntry": false,
|
||||||
|
"watchMode": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bun",
|
||||||
|
"internalConsoleOptions": "neverOpen",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Run File",
|
||||||
|
"program": "${file}",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"noDebug": true,
|
||||||
|
"watchMode": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
4
.vscode/mklink.md
vendored
4
.vscode/mklink.md
vendored
@ -40,3 +40,7 @@ mklink /J "L:\Git\AA\Windows\.vscode\.iCloudPhotos2025" "D:\7-Question\iCloud Ph
|
|||||||
{ "label": "Build-Rename", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/Rename/AA.Rename.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" },
|
{ "label": "Build-Rename", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/Rename/AA.Rename.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" },
|
||||||
{ "label": "Build-Shared", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/Shared/AA.Shared.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" },
|
{ "label": "Build-Shared", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/Shared/AA.Shared.csproj", "/property:GenerateFullPaths=true", "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" },
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```bash 1753233168670 = 638888299686700000 = 2025-3.Summer = Tue Jul 22 2025 18:12:48 GMT-0700 (Mountain Standard Time)
|
||||||
|
mklink /J "L:\Git\AA\.vscode\helper\.638443643487798783" "D:\5-Other-Small\DigiKam\0113C7C3FED381A-hidden-c\638443643487798783"
|
||||||
|
```
|
||||||
|
50
Scripts/immich.js
Normal file
50
Scripts/immich.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
const axios = require('axios');
|
||||||
|
|
||||||
|
const url = 'https://immich.bchs.duckdns.org';
|
||||||
|
|
||||||
|
let config = {
|
||||||
|
method: 'get',
|
||||||
|
maxBodyLength: Infinity,
|
||||||
|
// url: url + '/api/users',
|
||||||
|
url: url + '/api/assets/f89d0de1-2762-4f9e-b60e-c7eeec93c4e9',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'x-api-key': 'Pm2CbhJvgStEPAFKRVclW88qrOAy79OeIEcfj3k'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
axios.request(config)
|
||||||
|
.then((response) => {
|
||||||
|
console.log(JSON.stringify(response.data));
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
// let data = JSON.stringify({
|
||||||
|
// "avatar": {
|
||||||
|
// "color": "green"
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// let configB = {
|
||||||
|
// method: 'put',
|
||||||
|
// maxBodyLength: Infinity,
|
||||||
|
// url: url + '/api/users/me/preferences',
|
||||||
|
// headers: {
|
||||||
|
// 'Content-Type': 'application/json',
|
||||||
|
// 'Accept': 'application/json',
|
||||||
|
// 'x-api-key': 'Pm2CbhJvgStEPAFKRVclW88qrOAy79OeIEcfj3k'
|
||||||
|
// },
|
||||||
|
// data: data
|
||||||
|
// };
|
||||||
|
|
||||||
|
// axios.request(configB)
|
||||||
|
// .then((response) => {
|
||||||
|
// console.log(JSON.stringify(response.data));
|
||||||
|
// })
|
||||||
|
// .catch((error) => {
|
||||||
|
// console.log(error);
|
||||||
|
// });
|
||||||
|
|
36
Scripts/job-search.js
Normal file
36
Scripts/job-search.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import year from '../.vscode/helper/year.job.json' with { type: 'json' };
|
||||||
|
import event from '../.vscode/helper/event.job.json' with { type: 'json' };
|
||||||
|
|
||||||
|
let file;
|
||||||
|
let fromYear = [];
|
||||||
|
let fromEvent = [];
|
||||||
|
let fromYearEventPresent = [];
|
||||||
|
let fromEventYearPresent = [];
|
||||||
|
const pathA = 'L:/Git/AA/.vscode/helper/from-year-event-present.json';
|
||||||
|
const pathB = 'L:/Git/AA/.vscode/helper/from-event-year-present.json';
|
||||||
|
|
||||||
|
year.Files.forEach(element => {
|
||||||
|
file = element.RelativePath.split('\\')[1];
|
||||||
|
fromYear.push(file);
|
||||||
|
});
|
||||||
|
|
||||||
|
event.Files.forEach(element => {
|
||||||
|
file = element.RelativePath.split('\\')[1];
|
||||||
|
fromEvent.push(file);
|
||||||
|
if (fromYear.includes(file)){
|
||||||
|
fromYearEventPresent.push(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
year.Files.forEach(element => {
|
||||||
|
file = element.RelativePath.split('\\')[1];
|
||||||
|
if (fromEvent.includes(file)){
|
||||||
|
fromEventYearPresent.push(file);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const jsonA = JSON.stringify(fromYearEventPresent);
|
||||||
|
await Bun.write(pathA, jsonA);
|
||||||
|
|
||||||
|
const jsonB = JSON.stringify(fromEventYearPresent);
|
||||||
|
await Bun.write(pathB, jsonB);
|
27
Scripts/people-to-sql.js
Normal file
27
Scripts/people-to-sql.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import people from '../.vscode/helper/.638443643487798783/people.json' with { type: 'json' };
|
||||||
|
|
||||||
|
const pathA = 'L:/Git/AA/.vscode/helper/.638443643487798783/id-name.sql';
|
||||||
|
const pathB = 'L:/Git/AA/.vscode/helper/.638443643487798783/id-name.json';
|
||||||
|
|
||||||
|
let results = [];
|
||||||
|
let name = '';
|
||||||
|
let person = {};
|
||||||
|
let line = '';
|
||||||
|
let lines = [];
|
||||||
|
for (const property in people) {
|
||||||
|
person = people[property];
|
||||||
|
name = person.Name.Suffix == undefined || person.Name.Suffix.length === 0
|
||||||
|
? person.Name.ForwardSlashFull
|
||||||
|
: person.Name.ForwardSlashFull + ' ' + person.Name.Suffix;
|
||||||
|
line = `update Tags set name = '${name}' where name = '${person.Birth.Note}';`
|
||||||
|
lines.push(line);
|
||||||
|
line = `update TagProperties set value = '${name}' where value = '${person.Birth.Note}';`
|
||||||
|
lines.push(line);
|
||||||
|
results.push({ id: person.Birth.Note, name: name });
|
||||||
|
}
|
||||||
|
|
||||||
|
const text = lines.join('\n');
|
||||||
|
await Bun.write(pathA, text);
|
||||||
|
|
||||||
|
const json = JSON.stringify(results);
|
||||||
|
await Bun.write(pathB, json);
|
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "adaptation",
|
||||||
|
"module": "index.ts",
|
||||||
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bun": "latest"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"garbage-collect": "git gc"
|
||||||
|
}
|
||||||
|
}
|
29
tsconfig.json
Normal file
29
tsconfig.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
// Environment setup & latest features
|
||||||
|
"lib": ["ESNext"],
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "Preserve",
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
|
||||||
|
// Bundler mode
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"noEmit": true,
|
||||||
|
|
||||||
|
// Best practices
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
|
||||||
|
// Some stricter flags (disabled by default)
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"noPropertyAccessFromIndexSignature": false
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user