This file contains hidden or 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
import { deparse, parse } from "npm:pgsql-parser"; | |
import type { Node, ParseResult } from "npm:@pgsql/types"; | |
const schemaSql = ` | |
-- PostgreSQL schema | |
CREATE TYPE my_enum_example AS ENUM ('good', 'bad', 'ugly', 'dont know'); | |
CREATE TABLE | |
"various_types" ( | |
"bigserial" bigserial primary key, |
This file contains hidden or 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
# EDIT: There is more comprehensive debloat instructions here: https://github.com/sammilucia/ASUS-G14-Debloating/blob/main/README.md | |
# Get services starting with "Asus*" to a variable | |
$services = Get-Service -Name "Asus*" | |
# Stop services | |
foreach ($service in $services) { | |
# Print service | |
Write-Host "STOP" $service.Name | |
Stop-Service -Name $service.Name |
This file contains hidden or 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
import * as k from "npm:kysely"; | |
import { PGlite } from "npm:@electric-sql/pglite"; | |
function createPgLiteDialect(db: PGlite) { | |
return { | |
createDriver: () => | |
({ | |
acquireConnection: () => { | |
return Promise.resolve({ | |
executeQuery: async (compiledQuery) => { |
This file contains hidden or 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
import { createSQLiteThread, createHttpBackend } from "npm:sqlite-wasm-http"; | |
// This is required hack: | |
const OldWorker = globalThis.Worker; | |
// @ts-ignore: Default to module workers | |
globalThis.Worker = class { | |
constructor(url: URL, opts: any = {}) { | |
return new OldWorker(url, { type: "module", ...opts }); | |
} | |
}; |
This file contains hidden or 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
const pool = new Pool({ | |
max: 300, | |
connectionTimeoutMillis: 20000, | |
host: "127.0.0.1", | |
port: 5432, | |
user: 'citus', | |
password: () => "password", | |
database: 'citus', | |
ssl: false, |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
LOOK AT THE CONSOLE |
This file contains hidden or 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
// @deno-types="npm:@types/sql.js" | |
import { default as initSqlJs } from "npm:sql.js"; | |
import { IDatabase, QueryResult } from "./Database.ts"; | |
export class Database implements IDatabase { | |
private path: string; | |
private sqliteJs?: initSqlJs.SqlJsStatic; | |
private db?: initSqlJs.Database; | |
private inited = false; |
This file contains hidden or 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 | |
add_action("init", function () { | |
// Ob_start twice, intentionally | |
ob_start(); | |
?> | |
<script type="module"> | |
<?php ob_start(); ?> | |
wp.blocks.registerBlockType("temp/shortcode", { |
This file contains hidden or 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
use std::sync::mpsc::Sender; | |
use windows::{ | |
core::Result, | |
s, | |
Win32::{ | |
Foundation::{HANDLE, HWND, LPARAM, LRESULT, WPARAM}, | |
System::{ | |
LibraryLoader::GetModuleHandleA, | |
Power::{ |
This file contains hidden or 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
struct MyThreadWrapper { | |
thread: Option<std::thread::JoinHandle<()>>, | |
} | |
impl Drop for MyThreadWrapper { | |
fn drop(&mut self) { | |
if let Some(thread) = self.thread.take() { | |
let _ = thread.join(); | |
} | |
} | |
} |
NewerOlder