Skip to content

Instantly share code, notes, and snippets.

@jackysee
jackysee / PKGBUILD
Created July 11, 2024 17:39
modified PKGBUILD for mesa + arch + wsl2
# Maintainer: Laurent Carlier <lordheavym@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
pkgbase=mesa
pkgname=(
mesa
libva-mesa-driver
@jackysee
jackysee / use-dynamic-import-with-suspense-in-vue-router.md
Created October 31, 2022 10:08
Use dynamic import with <suspense> in vue-router
@jackysee
jackysee / vue3_emits.lua
Last active October 5, 2022 03:05
vue3_emits.lua
-- Prerequisite: install treesitter and vue syntax
-- place this file in your config path (e.g. nvim/after/plugin/ )
-- Run :VueEmits will find all the string after '$emit' in template or script,
-- and insert e.g. "emits: ['eventA', 'eventB']"
local q = require "vim.treesitter.query"
local function i(value) print(vim.inspect(value)) end
local get_vue_root = function(bufnr)
@jackysee
jackysee / extractNote
Created August 19, 2020 08:15
extract note as citation
var c = document.querySelector('.e-content').innerHTML;
var a = document.querySelector('.u-url');
var w = window.open('', '', 'width=400,height=200');
w.document.write(`<textarea style="width:90vw;height:80vh"><p><cite class="h-cite">Note on <a class="u-url" href="${a.href}">${a.innerText}</a></cite></p><blockquote>${c.trim()}</blockquote></textarea>`);
var t = w.document.querySelector('textarea');
t.addEventListener('click', function(){ t.select(); });
@jackysee
jackysee / youtubeClassMoreLinkFix.user.js
Last active June 22, 2020 09:58
Youtube classic more link fix
// ==UserScript==
// @name Youtube classic more link fix
// @namespace Youtube classic more link fix
// @match http*://www.youtube.com/watch*
// @grant none
// @version 1.0
// @author jackysee
// @description 6/16/2020, 11:53:24 AM
// ==/UserScript==
@jackysee
jackysee / youtubeClassNoEndCards.user.js
Created April 27, 2020 05:26
Youtube class no end cards
// ==UserScript==
// @name No End Cards - youtube.com
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/watch
// @grant none
// @version 1.0
// @author -
// @description 4/27/2020, 1:24:03 PM
// ==/UserScript==
@jackysee
jackysee / youtubeClassicPlaylistAutoNextToggle.user.js
Created April 24, 2020 02:08
Youtube classic playlist auto next toggle
// ==UserScript==
// @name Playlist auto next toggle - youtube.com
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/watch
// @grant none
// @version 1.0
// @author -
// @description 4/24/2020, 10:01:32 AM
// ==/UserScript==
2019-03-21 09:19:10,731 [DEBUG @ msgpack_stream.py:send:33] 23676 - sent [0, 1, b'vim_get_api_info', ()]
2019-03-21 09:19:10,732 [DEBUG @ base.py:send:117] 23676 - Sending 'b'\x94\x00\x01\xb0vim_get_api_info\x90''
2019-03-21 09:19:10,732 [DEBUG @ base.py:run:142] 23676 - Entering event loop
2019-03-21 09:19:10,754 [DEBUG @ msgpack_stream.py:_on_data:58] 23676 - waiting for message...
2019-03-21 09:19:10,754 [DEBUG @ msgpack_stream.py:_on_data:60] 23676 - received message: [1, 1, None, [1, {b'version': {b'major': 0, b'api_level': 1, b'api_prerelease': False, b'patch': 7, b'api_compatible': 0, b'minor': 1}, b'types': {b'Window': {b'id': 1, b'prefix': b'nvim_win_'}, b'Tabpage': {b'id': 2, b'prefix': b'nvim_tabpage_'}, b'Buffer': {b'id': 0, b'prefix': b'nvim_buf_'}}, b'functions': [{b'method': True, b'name': b'nvim_buf_line_count', b'return_type': b'Integer', b'parameters': [[b'Buffer', b'buffer']], b'since': 1}, {b'method': False, b'deprecated_since': 1, b'name': b'buffer_get_line', b'return_type': b'String', b'
@jackysee
jackysee / urbtixreloaded.user.js
Created October 12, 2018 10:00
reload urbtix
// ==UserScript==
// @name reload urbtix
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://msg.urbtix.hk/*
// @match *://busy.urbtix.hk/*
// @grant none
// ==/UserScript==
window.location.href = '//www.urbtix.hk';
@jackysee
jackysee / index.html
Created June 13, 2018 10:09
Device orientation derived by DeviceMotionEvent with screen orientation locked
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>Device Orientation by DeviceMotionEvent</title>
<style>
body{ margin:0; padding:0; font-family: sans-serif;}
.main{
width: 100%;