Skip to content

Instantly share code, notes, and snippets.

View fregante's full-sized avatar

fregante

View GitHub Profile
@fregante
fregante / header.js
Last active May 21, 2016 12:01 — forked from dominikwilkowski/00-README.md
Doc strange outline love (jQuery-free)
//detecting tab key press
document.body.addEventListener('keydown', function detector (e) {
var keyCode = e.keyCode || e.which;
if(keyCode == 9) {
console.log( 'Tab detected' );
document.documentElement.className += ' is-keyboarduser';
document.body.removeEventListener('keydown', detector);
@fregante
fregante / github-open-npm.js
Created August 10, 2024 15:53 — forked from kiliman/github-open-npm.js
TamperMonkey script to open the npm package by Ctrl/Cmd+click on import statement from GitHub code view
// ==UserScript==
// @name GitHub open npm from import
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description Opens the npm package by Ctrl/Cmd+click on import statement
// @author Kiliman
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?domain=github.com
// @grant none
// ==/UserScript==
@fregante
fregante / github-open-npm.js
Created August 10, 2024 15:53 — forked from kiliman/github-open-npm.js
TamperMonkey script to open the npm package by Ctrl/Cmd+click on import statement from GitHub code view
// ==UserScript==
// @name GitHub open npm from import
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description Opens the npm package by Ctrl/Cmd+click on import statement
// @author Kiliman
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?domain=github.com
// @grant none
// ==/UserScript==
@fregante
fregante / typescript_bundler.ts
Created April 23, 2025 12:14 — forked from DanielSRS/typescript_bundler.ts
Bundle a set of typescript files into a single one without modifying the source code
import ts from "typescript";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const SKIP_THIRD_PARTY_MODULES = true;
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/**
* Get the module path based on the base directory.