Skip to content

Instantly share code, notes, and snippets.

View franklinjavier's full-sized avatar

Franklin Javier franklinjavier

View GitHub Profile
@jacob-ebey
jacob-ebey / image.ts
Last active February 29, 2024 05:25
Remix Image Component
import { createHash } from "crypto";
import fs from "fs";
import fsp from "fs/promises";
import path from "path";
import https from "https";
import { PassThrough } from "stream";
import type { Readable } from "stream";
import type { LoaderFunction } from "remix";
import sharp from "sharp";
import type { Request as NodeRequest } from "@remix-run/node";
# scaffold your project
npx preact-cli@rc create default my-app && cd my-app
# upgrade to Preact X
npm i -D preact-cli@rc && npm i preact@latest preact-router@latest preact-render-to-string@latest
npm rm preact-compat

suspense-loader

Installation (sorry)

npm i THIS_URL

Usage

@d-akara
d-akara / JavaScriptSafeNavigation.md
Last active April 11, 2024 16:18
JavaScript Safe Navigation

Experimental Safe JavaScript Navigation

Implemented using ES6 Proxies and Symbols

The purpose of this function is to provide a way to avoid deep nested conditionals when traversing a hierarchy of objects. Some languages use an operator such as '?.' to perform this capability. This is sometimes called safe navigation or null conditional operators.

You can somewhat think of this as how a xpath select works. If any nodes along the path are not found, your result is simply not found without throwing an exception and without needing to check each individual node to see if it exists.

Suggestions for improvements welcome!

@k8adev
k8adev / bins-elo.md
Last active August 1, 2023 14:44
Bins para validação de cartões de crédito ELO

Validação para cartão de crédito ELO

Bins

Os bins foram ordenados pelo início dos 4 primeiros dígitos.

  • 4011
  • 4389 3 5
  • 4514 1 6
  • 4576
@ohanhi
ohanhi / frp.md
Last active December 23, 2022 13:06
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@rafaeljesus
rafaeljesus / oportunidade.md
Last active March 22, 2016 04:28
Senior Software Engineer

A GSW está com vaga para Senior Software Engineer full-time para projeto de longa duração

Descrição

Buscamos profissionais apaixonados e experientes, com visão arquitetural no contexto de APIs, arquiteturas orientadas a serviços e que se orgulham do código que produzem

Stack Atual

Backend - Nodejs(express, koajs, wascally, mongoose, bluebird, mocha, chai, supertest), Rabbitmq, Mongodb, Redis

@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
var mandrill = require('mandrill-api/mandrill'),
async = require('async'),
User = require('../../models').User;
module.exports = function (apiKey, lang) {
// setup mandrill api
var mandrill_client = new mandrill.Mandrill(apiKey);
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links