This file contains 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
// [dependencies] | |
// serde_json = "1.0.96" | |
// lsp-types = "=0.94" | |
// lsp-server = "0.7.1" | |
use std::error::Error; | |
use std::io::{Read, Write}; | |
use std::process::Stdio; | |
use lsp_types::{ |
This file contains 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 home_dir from "https://deno.land/x/[email protected]/home_dir/mod.ts"; | |
const updateAll = Deno.args.find((a) => a === "--update-all"); | |
const binsPath = home_dir() + "/.nimble/bin"; | |
for (const dirEntry of Deno.readDirSync(binsPath)) { | |
if (!dirEntry.isSymlink) continue; | |
const realBinPath = Deno.realPathSync(binsPath + "/" + dirEntry.name); |
This file contains 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 { | |
parse as parseRon, | |
} from "https://raw.githubusercontent.com/sigmaSd/RonDeno/master/mod.ts"; | |
import { stringify as stringifyToml } from "https://deno.land/[email protected]/encoding/toml.ts"; | |
import * as path from "https://deno.land/[email protected]/path/mod.ts"; | |
console.log( | |
stringifyToml( | |
parseRon( | |
await fetch(urlFromArg(Deno.args[0])).then((r) => r.text()), |
This file contains 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 { stringify } from "https://deno.land/[email protected]/encoding/toml.ts"; | |
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"; | |
import * as path from "https://deno.land/[email protected]/path/mod.ts"; | |
import configDir from "https://deno.land/x/[email protected]/config_dir/mod.ts"; | |
function assert(val: unknown, msg: string): asserts val { | |
if (val === null || val === undefined) throw new Error(msg); | |
} | |
async function main() { |
This file contains 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 std/genasts | |
import std/jsconsole | |
import std/strutils | |
import std/macros | |
import std/tables | |
import std/strformat | |
import std/sequtils | |
from std/jsffi import JsObject | |
macro js*(args: untyped): untyped = |
This file contains 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 cache_dir from "https://deno.land/x/[email protected]/cache_dir/mod.ts"; | |
import { ensureDirSync } from "https://deno.land/[email protected]/fs/ensure_dir.ts"; | |
export interface Options { | |
prelude?: string; | |
permissions?: string[]; | |
} | |
// deno-lint-ignore no-explicit-any | |
export default function installFn(fn: any, options?: Options) { |
This file contains 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
export const getDenoJson = async () => { | |
const parseMaps = (maps: string) => { | |
const data = []; | |
for (const line of maps.split("\n")) { | |
if (!line) { | |
continue; | |
} | |
const [adddrRange, flags, , , , name] = line.split(/ +/); | |
data.push({ |
This file contains 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 maps = () => Deno.readTextFileSync("/proc/self/maps").trim(); | |
const parseMaps = (maps: string) => { | |
const data = []; | |
for (const line of maps.split("\n")) { | |
const [adddrRange, flags, , , , name] = line.split(/ +/); | |
data.push({ | |
name: name !== "" ? name : undefined, | |
startAddr: parseInt(adddrRange.split("-")[0], 16), | |
endAddr: parseInt(adddrRange.split("-")[1], 16), | |
flags: { |
This file contains 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 homeDir = () => { | |
switch (Deno.build.os) { | |
case "linux": | |
case "darwin": | |
return Deno.env.get("HOME"); | |
case "windows": | |
return Deno.env.get("USERPROFILE"); | |
} | |
}; | |
const binaryPathFromName = (name: string) => `${homeDir()}/.deno/bin/${name}`; |
This file contains 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 $ = async (e: string) => { | |
await Deno.run({ | |
cmd: ["sh", "-c", e], | |
}).status(); | |
}; | |
const MAKE = "make"; | |
const PUBLIC_DIR = "public"; | |
const OUT_DIR = "build"; |
NewerOlder