Skip to content

Instantly share code, notes, and snippets.

View wawahuy's full-sized avatar
🐱

Nguyễn G.Huy wawahuy

🐱
View GitHub Profile
@alyleite
alyleite / wsl.md
Last active May 5, 2024 01:30
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

==============================================

Edit*

  1. Open /etc/wsl.conf with any editor:
@badrazizi
badrazizi / OKRU.js
Last active May 1, 2024 20:53
javascripts Extract OK.RU Video Links
/**
*
* ok.ru links work with header User-Agent Gecko
* 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
* i tried chrome and webkit both does not work
*
*/
const $ = require('jquery');
// Extract OK.RU Links
@nerdyman
nerdyman / resolve-tsconfig-path-to-webpack-alias.js
Last active March 5, 2024 01:25
Convert TypeScript tsconfig paths to webpack alias paths
const { resolve } = require('path');
/**
* Resolve tsconfig.json paths to Webpack aliases
* @param {string} tsconfigPath - Path to tsconfig
* @param {string} webpackConfigBasePath - Path from tsconfig to Webpack config to create absolute aliases
* @return {object} - Webpack alias config
*/
function resolveTsconfigPathsToAlias({
tsconfigPath = './tsconfig.json',
@sbarratt
sbarratt / keyboardhook.cpp
Created May 31, 2016 19:49
Create a keyboard hook using Win32 System API and log what the user types into a console.
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
#include <iostream>
HHOOK hHook{ NULL };
enum Keys
{
ShiftKey = 16,