Skip to content

Instantly share code, notes, and snippets.

@marcello3d
marcello3d / FetchTest.test.ts
Created February 2, 2025 04:32
nock back fetch bug
// Copyright 2025 Descript, Inc
import { back as nockBack } from 'nock';
import path from 'path';
describe('FetchTest', () => {
it('can do parallel fetches', async () => {
nockBack.fixtures = path.join(__dirname, '__nocks__');
const { nockDone } = await nockBack(`test.json`);
await Promise.all([fetch('https://api.github.com'), fetch('https://api.github.com')]);
nockDone();
@marcello3d
marcello3d / hide-skipped-jobs.js
Created July 29, 2024 07:14
Tampermonkey script to hide
// ==UserScript==
// @name Hide skipped jobs on github
// @version 0.0.1
// @match https://github.com/descriptinc/*/actions/runs/*
// @match https://github.com/descriptinc/*/pull/*
// @description
// ==/UserScript==
// Inspired by https://github.com/orgs/community/discussions/18001#discussioncomment-6532796
// Used ChatGPT 4o for mutation observer code
@marcello3d
marcello3d / common.frag
Created May 20, 2022 21:15
2d vector library in webgl by paniq (public domain) - https://www.shadertoy.com/view/lslXW8
// 2d vector graphics library (https://www.shadertoy.com/view/lslXW8)
// after Cairo API, with anti-aliasing
// by Leonard Ritter (@paniq)
// v0.16
// I release this into the public domain.
// some estimators have been lifted from other shaders and are not
// necessarily PD licensed, note the links in the source code comments below.
// 2020-12-02: 0.16
@marcello3d
marcello3d / gist:4e88b9af81b6c0e49b6e
Last active April 14, 2020 08:51
iOS Helvetica Neue Test
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimal-ui">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="mobile-web-app-capable" content="yes">
<style>
html,body {
@marcello3d
marcello3d / bson-benchmark.js
Created November 14, 2011 15:22
mongodb-native vs node-buffalo benchmark
var BSON = require('../buffalo'),
BSONPure = require('mongodb').BSONPure.BSON//,
// BSONNative = require('mongodb').BSONNative.BSON
var COUNT = 100000
var object = {
string: "Strings are great",
decimal: 3.14159265,
bool: true,
integer: 5,
@marcello3d
marcello3d / launcher.js
Created March 28, 2011 02:59
little node.js reloader
/*
* This file is part of the Spludo Framework.
* Copyright (c) 2009-2010 DracoBlue, http://dracoblue.net/
*
* Licensed under the terms of MIT License. For the full copyright and license
* information, please see the LICENSE file in the root folder.
*/
/*
* based on https://github.com/DracoBlue/spludo/blob/master/build/run_dev_server.js
@marcello3d
marcello3d / log.js
Created March 24, 2011 03:45
simple log4js wrapper
var log4js = require('log4js')()
log4js.addAppender(log4js.consoleAppender())
/**
* Get a logger. If no name is specified, retrieve the caller's filename
* example:
* var log = require('./log.js')()
*/
module.exports = function(name) {
if (!name) {
function addRoute(app, path, controllerName) {
var controller = require("./controllers/" + (controllerName || path) )
['get','post','put','delete','all'].forEach(function (method) {
if (controller[method]) {
app[method](path, controller[method])
}
})
}
var fs = require("fs")
var sprintf = require('sprintf').sprintf
fs.readFile(__dirname+"/npmdump.json", function (err, data) {
if (err) throw err
var packages = JSON.parse(data)
fs.readFile("../output.json", function (err, data) {
if (err) throw err
@marcello3d
marcello3d / gist:854219
Created March 4, 2011 05:23
nithub (npmjs + github) keyword deathmatch!
ace KEYWORD DEATHMATCH
1. ace 829 score - https://github.com/ajaxorg/ace
2. vice 8 score - https://github.com/Gozala/vice
amazon KEYWORD DEATHMATCH
1. aws-lib 105 score - https://github.com/mirkok/aws-lib
2. simpledb 14 score - https://github.com/rjrodger/simpledb
3. aws 2 score - https://github.com/teemow/node-aws
apache KEYWORD DEATHMATCH