Skip to content

Instantly share code, notes, and snippets.

View piscisaureus's full-sized avatar
🦕

Bert Belder piscisaureus

🦕
View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

D:\>v8-svn\build\Debug\d8 test.js --print_code --print_code_verbose --code_comments --nouse_inlining
--- Raw source ---
var counter = 0;
function it() {
if (counter > 100000) return;
return ++counter;
}
function call_iota() {
const resources = {
"/": file("text/html")`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="module" src="main.js"></script>
</head>
<body>
<p>Open developer tools. There will be nothing to see here.</p>
@piscisaureus
piscisaureus / build.sh
Last active June 25, 2021 02:12
deno icons
#!/bin/sh
# This script generates multi-size .ico files from the highly stylized "simple"
# Deno logos, designed by HashRock.
# The complication stems from the fact the the dimensions of the original .png
# files is 252x252 pixels. Naively rescaling these images to 256x256 or any
# other power of 2 produces ugly artifacts.
# Note that the output of the black-and-white logo transformation isn't
import "./mod_a.js";
await 0;
import "./mod_b.js";
const React = {
createElement(...args) { console.log(this, ...args); return new String("ReactElement"); }
};
const foo = (...args) => { console.log(this, ...args); return "FooEl"; };
console.log(<foo>a ${111} {222} $c</foo>);
console.log("bar");
This file has been truncated, but you can view the full file.
// Capture - remove by function pointer and data
void AddGCPrologueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr);
void AddGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr, GCType gc_type_filter = kGCTypeAll);
void RemoveGCEpilogueCallback(GCCallbackWithData callback, void* data = nullptr);
void AddMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr);
void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallbackWithData callback, void* data = nullptr) = 0;
First number is the size (in bytes) of the stack frame. The largest frames are on top.
+ 60480 0x000000B1E05AD690 frame #77: 0x00007ff6b6e7fd44 deno.exe`union core::result::Result<swc_ecma_ast::module::ModuleItem, swc_common::errors::diagnostic_builder::DiagnosticBuilder> swc_ecma_parser::parser::Parser<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>>::parse_stmt_like<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>,swc_ecma_ast::module::ModuleItem>(self=0x000000b1e05b00d0, include_decl=true, top_level=true) at stmt.rs:82
+ 60480 0x000000B1E055F110 frame #48: 0x00007ff6b6e7f784 deno.exe`union core::result::Result<swc_ecma_ast::stmt::Stmt, swc_common::errors::diagnostic_builder::DiagnosticBuilder> swc_ecma_parser::parser::Parser<swc_ecma_parser::parser::input::Capturing<swc_ecma_parser::lexer::Lexer<swc_common::input::SourceFileInput>>>::parse_stmt_like<swc_ecma_parser::parser::input:
D:\deno2\tests>..\target\debug\deno -A --reload main.js
Compile file:///D:/deno2/tests/subdir/mod2.ts
Compile file:///D:/deno2/tests/subdir/mismatch_ext.ts
Compile file:///D:/deno2/tests/subdir/mod1.ts
Download https://raw.githubusercontent.com/denoland/deno/v0.0.1/package.json
error: Uncaught Error: An error
► file:///D:/deno2/tests/subdir/throws.js:5:7
5 throw new Error("An error");
^
async function try_import(url) {
let status;
try {
await import(url);
status = "OK";
} catch (err) {
status = err.name;
}
status = status.padEnd(12);
return status + url;