Skip to content

Instantly share code, notes, and snippets.

View espindola's full-sized avatar

Rafael Ávila de Espíndola espindola

View GitHub Profile
@espindola
espindola / main.rs
Created June 28, 2022 09:47
snapshot test
use anyhow::Result;
use deno_core::anyhow;
use deno_core::futures::FutureExt;
use deno_core::url::Url;
use deno_core::JsRuntime;
use deno_core::ModuleSource;
use deno_core::ModuleSourceFuture;
use deno_core::ModuleType;
use deno_core::RuntimeOptions;
use std::pin::Pin;
use std::ops::DerefMut;
struct Foo {
a: i32,
b: bool,
}
fn foo(_: &mut i32, _: bool) {}
fn main() {
let f = Foo { a: 42, b: true };
use std::ops::DerefMut;
use std::ops::Deref;
struct Foo {
a: i32,
b: bool,
}
fn foo(_: &mut i32, _: bool) {}
struct Bar {
@espindola
espindola / lib.rs
Created October 6, 2021 17:53
Local get example
use v8::Handle;
use rusty_v8 as v8;
pub fn foo<'a>(func: v8::Local<v8::Function>, obj: v8::Local<v8::Object>,scope: &mut v8::HandleScope<'a>,) {
func.call(scope, obj.into(), &[]);
let key = v8::String::new(scope, "key").unwrap();
obj.get(scope).get(scope, key.into()); // this compiles only with "use v8::Handle"
obj.get(scope, key.into()); // this compiles only without "use v8::Handle"
}
@espindola
espindola / mozllia-toronto.txt
Created December 8, 2011 13:37
mozilla #toronto log
Nov 15 11:45:01 <AaronMT> http://www.toronto.ca/newsroom/OccupyNotice.pdf
Nov 15 11:45:46 <beltzner> OH MY GOD
Nov 15 11:45:50 <beltzner> THOSE NAZIS
Nov 15 11:45:53 <beltzner> no, wait
Nov 15 11:45:56 <beltzner> that's actually a pretty reasonable request
Nov 15 11:46:04 <AaronMT> Indeed
Nov 15 11:46:11 <beltzner> "No more camping out in public parks, please. Come back at 5am, leave at midnight."
Nov 15 11:46:39 <mdas> yeah that's pretty reasonable
Nov 15 11:48:06 * anode|away (alice@moz-62185DFD.cable.teksavvy.com) has joined #toronto
Nov 15 11:48:41 <bhearsum> to be honest, i was surprised that was allowed in the first place