Skip to content

Instantly share code, notes, and snippets.

View kuanyui's full-sized avatar
❄️
なんでそんなに慣れてんだよ!

クエン酸 kuanyui

❄️
なんでそんなに慣れてんだよ!
View GitHub Profile
@konradmb
konradmb / generate-thumbnails.py
Last active October 27, 2024 13:55
Generate thumbnails in Gnome
#!/usr/bin/python3
import os
import sys
from concurrent.futures import ThreadPoolExecutor
import gi
from gi.repository import Gio, GnomeDesktop
gi.require_version('GnomeDesktop', '4.0')
SSH_ENV="$HOME/.ssh/agent-environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
@harish2704
harish2704 / zypper-print-urls.sh
Last active August 13, 2024 06:13
Print URLs of rpm package instead of downloading while using zypper package manager ( OpenSUSE )
#!/bin/bash
# Usage:
# zypper-print-urls.sh pkg1 pk2 pkg3 ...
# This script actualy create a solver state and
# then derives urls from the sovler state.
solverDir=$(zypper install --debug-solver $@ | grep 'successfully at' | sed 's#Solver test case generated successfully at \(.*\).#\1#' )
@aszx87410
aszx87410 / README.md
Last active December 8, 2023 21:59
let vs var by investigating the bytecode generated by Node.js

It's the reply to the question raised by @getify on his twitter:

here's a variation on the question... will JS engines exhibit much performance difference between these two loops?

for (var i = 0; i < 100000000; i++) {
   // do some stuff, but not closure
}

for (let i = 0; i < 100000000; i++) {
@rsperl
rsperl / Makefile #snippet
Last active April 17, 2024 23:02
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
@loilo
loilo / pass-slots.md
Last active October 16, 2024 18:16
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@ObserverOfTime
ObserverOfTime / WA2-Ubuntu.md
Last active February 11, 2024 07:05
Install and patch White Album 2 on Linux

For Ubuntu and other Debian-based distros

This gist is deprecated. You can find the latest instructions here.

1: Enable Japanese Locale

Check whether it's already enabled:

$ locale -a | grep ja
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import TerminalFormatter
from pprint import pformat
import json
def pprint_color(obj, indent=2):
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active November 17, 2024 08:50
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub