add day 13, SSRgit checkout maingit checkout mainsudo pacman -S virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat

checkout
This commit is contained in:
Zoe
2022-10-05 21:10:51 -05:00
parent cf198b63a5
commit 6855cb94f3
28 changed files with 5458 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
export function setCookie(name, value, expires, path, domain) {
if (import.meta.env.SSR) return
var cookie = name.trimEnd() + "=" + escape(value) + ";";
if (expires) {
// If it's a date
if(expires instanceof Date) {
// If it isn't a valid date
if (isNaN(expires.getTime()))
expires = new Date();
}
else
expires = new Date(new Date().getTime() + parseInt(expires) * 1000 * 60 * 60 * 24);
cookie += "expires=" + expires.toGMTString() + ";";
}
if (path)
cookie += "path=" + path + ";";
if (domain)
cookie += "domain=" + domain + ";";
document.cookie = cookie;
}
export function getCookie(name) {
if (import.meta.env.SSR) return
let cname = name + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(cname) == 0) {
return c.substring(cname.length, c.length);
}
}
return "";
}