Skip to content

Instantly share code, notes, and snippets.

View bsdelf's full-sized avatar

bsdelf bsdelf

  • Shanghai
View GitHub Profile
@bsdelf
bsdelf / yarn-list.js
Last active June 7, 2023 12:55
yarn list direct dependencies with locked version
const path = require('path');
const exec = require('child_process').exec;
function run(command) {
return new Promise((resolve, reject) => {
exec(command, function (error, stdout, stderr) {
if (error) {
reject(error);
} else {
resolve(stdout);
class Range {
constructor(from, to, step = 1) {
this.value = from;
this.to = to;
this.step = step;
}
next() {
if (this.value > this.to) {
return { value: undefined, done: true };
@bsdelf
bsdelf / gist:be794d961cce72781dcec1e4a78c0724
Last active December 1, 2022 03:44
how to customize xfce4-terminal shortcuts
% cat ~/.config/xfce4/terminal/accels.scm
(gtk_accel_path "<Actions>/terminal-window/new-tab" "<Super>t")
(gtk_accel_path "<Actions>/terminal-window/close-tab" "<Super>w")
(gtk_accel_path "<Actions>/terminal-window/copy" "<Super>c")
(gtk_accel_path "<Actions>/terminal-window/paste" "<Super>v")
(gtk_accel_path "<Actions>/terminal-window/search" "<Super>f")
(gtk_accel_path "<Actions>/terminal-window/prev-tab" "<Super>Left")
(gtk_accel_path "<Actions>/terminal-window/next-tab" "<Super>Right")
(gtk_accel_path "<Actions>/terminal-window/move-tab-left" "<Super><Shift>Left")
(gtk_accel_path "<Actions>/terminal-window/move-tab-right" "<Super><Shift>Right")
@bsdelf
bsdelf / hide-twitter-trending.js
Created March 9, 2023 06:20
hide-twitter-trending.js