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 November 12, 2024 19:20
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

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

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 the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), 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

@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active November 14, 2024 10:53
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 October 20, 2024 20:43
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 July 29, 2024 01:23
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.