Skip to content

Instantly share code, notes, and snippets.

Avatar

Porfirio porfirioribeiro

View GitHub Profile
View rename.ts
const skywatchRE = /SKYWATCH_(PL_PS|S2_MS)_(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})/;
const entries = [];
for await (const dirEntry of Deno.readDir(".")) {
const match = dirEntry.name.match(skywatchRE);
if (match) {
const sat = match[1];
const date = `${match[2]}-${match[3]}-${match[4]}T${match[5]}-${match[6]}`;
const renamed = `${date}_SKYWATCH_${sat}.tif`;
@porfirioribeiro
porfirioribeiro / index.d.ts
Last active Jan 24, 2020
preact-composition
View index.d.ts
import { PreactContext, JSX, Component } from 'preact';
export * from './store';
type FC<P> = (props: P) => JSX.Element;
type createComponentFN<P> = (c: Component<P>) => FC<P>;
/**
* Wraps a FunctionalComponent to be handled with the composition api
* @param fn
*/
@porfirioribeiro
porfirioribeiro / Composition.md
Created Jan 6, 2020
Preact Composition API
View Composition.md

Preact Composition API

  • Toughts and doubts
  • Reactivity
  • Current implementation
  • Component based implementation

Toughts and doubts

  • displayName
@porfirioribeiro
porfirioribeiro / Generate.hx
Last active Aug 29, 2015
Advanced Custom JS generator.
View Generate.hx
package ;
import haxe.macro.Compiler;
import haxe.macro.Context;
import haxe.macro.Type;
import haxe.macro.Expr;
import haxe.macro.JSGenApi;
using haxe.macro.Tools;
using Lambda;
using StringTools;
@porfirioribeiro
porfirioribeiro / Main.hx
Created Jun 10, 2013
Haxe TypeCheck in JavaScript with macros
View Main.hx
package ;
using TypeCheck;
/**
* @author Porfirio
*/
class Main {
public function new() {}
static function main() {
var m = new Main();
You can’t perform that action at this time.