Skip to content

Instantly share code, notes, and snippets.

View privatenumber's full-sized avatar

Hiroki Osame privatenumber

View GitHub Profile
@privatenumber
privatenumber / typescript-v5-to-v6.md
Created February 24, 2026 13:21
TypeScript 5.x to 6.0 Migration Guide

TypeScript 5.x to 6.0 Migration Guide

TypeScript 6.0 is a transition release bridging 5.9 and the forthcoming 7.0 (a native Go port). Most changes are new defaults and deprecations preparing for 7.0. Here is what you need to do:

Most projects need these tsconfig changes:

{
    "compilerOptions": {
        "types": ["node"],           // @types are no longer auto-discovered (see §1.6)
@privatenumber
privatenumber / light-dark-image.svg
Last active October 22, 2024 05:40
Light/dark mode SVG image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@privatenumber
privatenumber / VueLifecycleTap.js
Created January 18, 2019 16:13
Vue lifecycle tap
window.VueLifecycleTap = ['beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'beforeDestroy', 'destroyed'].reduce((agg, curr) => {
agg[curr] = function() {
console.log(`uid: ${this._uid} -`, curr);
};
return agg;
}, {});
(function BFS(obj, lookingFor, maxFinds = 100, maxDuration = 3) {
console.log('Traversing', obj, 'to find', lookingFor);
let findCount = 0;
let timedOut = false;
let queue = [[obj, '']];
setTimeout(() => (timedOut = true), maxDuration * 1000);
@privatenumber
privatenumber / requirejs.reload.js
Created July 7, 2016 06:11
Require.js "Watch" Implementation
var reload = (function () {
'use strict';
var cache = {};
var refresh = {};
var execCb = window.requirejs.s.contexts._.execCb;
window.requirejs.s.contexts._.execCb = function (name, callback) {