Skip to content

Instantly share code, notes, and snippets.

View StephenFluin's full-sized avatar

Stephen Fluin StephenFluin

View GitHub Profile
import { Component, Output } from '@angular/core';
import { Subject } from 'rxjs';
@Compnent({
template: '<child-component (myCustomEvent)="myOtherEvent.next($event)"></child-component>',
})
export class EmitComponent {
@Output() myOtherEvent = new Subject<any>();
}
@StephenFluin
StephenFluin / contributors.md
Last active May 28, 2019 19:32
8.0.0 Contributors

Adam Bradley, Adam Plumer, Adam Yi, Ahsan Ayaz, Alan, Alan Agius, Alberto Garza, Alex Eagle, Alexey Zuev,

import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: 'img'
})
export class LazyImagesDirective {
constructor(ref: ElementRef) {
ref.nativeElement.loading = 'lazy';
}
let lcp = await page.evaluate(() => new Promise((resolve, reject) => {
try {
// Create a variable to hold the latest LCP value (since it can change).
let lcp;
// Create the PerformanceObserver instance.
const po = new PerformanceObserver((entryList) => {
const entries = entryList.getEntries();
const lastEntry = entries[entries.length - 1];
@StephenFluin
StephenFluin / equipment.md
Last active March 30, 2022 16:43
My equipment and setup
@StephenFluin
StephenFluin / gmp-verified.sol
Created July 18, 2023 07:20
A quick example of writing an Axelar Executable that only accepts messages from a single source
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {AxelarExecutable} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol";
import {IAxelarGateway} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol";
import {IAxelarGasService} from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SenderReceiver is AxelarExecutable, Ownable {
IAxelarGasService public immutable gasService;
@StephenFluin
StephenFluin / a.directive.ts
Last active September 29, 2023 00:03
A directive to automatically make all external `a` links noopener, noreferrer, and target _blank.
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: 'a',
standalone: true,
})
export class ADirective {
constructor(public ref: ElementRef) {}
ngAfterViewInit() {
@StephenFluin
StephenFluin / gmp2.sol
Created January 28, 2025 06:23
Modern Axelar GMP Example
pragma solidity ^0.8.0;
import { AxelarExecutable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol';
import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol';
import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
contract SenderReceiver is AxelarExecutable {
IAxelarGasService public immutable gasService;
string public message;