Skip to content

Instantly share code, notes, and snippets.

View maz-1's full-sized avatar
🐢
slow to respond

maz-1 maz-1

🐢
slow to respond
  • WolkenVision AG
  • China
View GitHub Profile
@brianglass
brianglass / proxy.py
Created July 29, 2021 17:41
Django Channels Websocket Proxy
import asyncio
import logging
import websockets
from channels.exceptions import DenyConnection
from channels.generic.websocket import AsyncWebsocketConsumer
from django.utils.functional import cached_property
logger = logging.getLogger(__name__)
@cliss
cliss / mergechapters.py
Created January 26, 2021 14:30
Merge Files with Chapters
import datetime
import json
import os
import subprocess
import sys
#############
### USAGE ###
#############
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active May 10, 2024 03:49
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active March 21, 2024 15:30
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@norcalli
norcalli / yay-update-ignore-errors
Last active February 22, 2023 09:34
A wrapper script to run yay and incrementally build a list of packages to ignore if they error out.
#!/bin/sh
# Wrapper script around yay to try to ignore errors
# Copyright © 2019 Ashkan Kiani
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@nuhuo08
nuhuo08 / shadowsocks_ubuntu1604.org
Created March 11, 2019 09:44
Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install Shadowsocks-libev + simple-obfs on Ubuntu 16.04

Install shadowsocks-libev via Ubuntu PPA

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y
sudo apt-get update
sudo apt install shadowsocks-libev

Linux on x96 2GB/16GB TV box

Power

CAUTION: When powering it via the VCC line on the internal serial connector, it probably needs 3.3V rather than 5V!

x96 2GB/16GB
@marcusbelcher
marcusbelcher / install_emscripten.bat
Last active March 27, 2024 12:38
Install Emscripten / Emsdk on Windows 10 via CMD
git clone https://github.com/juj/emsdk.git
cd emsdk
rd /s /q clang
rd /s /q emscripten
rd /s /q java
rd /s /q node
rd /s /q python
rd /s /q zips
git reset --hard HEAD
git checkout master
@duhaime
duhaime / index.html
Last active May 27, 2023 17:19
Three.js points mesh + ShaderMaterial
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>title</title>
<style>
body, html {
margin: 0;
padding: 0;
background: #000;
@gboeer
gboeer / MyGraphicsView.cpp
Created February 9, 2018 14:40
Enable dragging of a QT5 QGraphicsView with middle mouse button (or any other button than the default)
/**
So you want to use the QGraphicsView Drag Mode but with another mouse button than the default left click?
You can of course reimplement the mouse_move_event in a subclass but did you notice how ugly it is to implement
all the dragging functionality by yourself?
All you want to do is use another mouse_button with the existing dragging functionality
but there is no such thing as a setDraggingButton function.
Here we use a little hack which enables the dragging mode only temporarly when clicking a button of your choice and then
sends a left-click event which will trigger the standard dragging functionality of the QGraphicsView.