Skip to content

Instantly share code, notes, and snippets.

@lightrush
lightrush / 100-qudelix.rules
Created October 9, 2023 22:35
Qudelix 5K udev rule for Chrome app connection over USB
SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", MODE="0660", GROUP="plugdev", TAG+="uaccess"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", , GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
@ryuheechul
ryuheechul / KOReader-on-rm2.md
Last active January 23, 2026 19:11
Installing KOReader on Remarkable 2
# MIT LICENSE
import datetime
import plotly.graph_objs as go
from plotly.subplots import make_subplots
import numpy as np
import dash_core_components as dcc
import dash_html_components as html
import dash
@mhsamiei
mhsamiei / gonicorn_nginx_django.md
Last active January 11, 2025 05:10
deploy django with nginx and gunicorn config

Testing Gunicorn’s Ability to Serve the Project The last thing we want to do before leaving our virtual environment is test Gunicorn to make sure that it can serve the application. We can do this by entering our project directory and using gunicorn to load the project’s WSGI module:

    (myenv) $ cd ~/myprojectdir
    (myenv) $ gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Creating systemd Socket and Service Files for Gunicorn We have tested that Gunicorn can interact with our Django application, but we should implement a more robust way of starting and stopping the application server. To accomplish this, we’ll make systemd service and socket files.

@EtsuNDmA
EtsuNDmA / django_jupyter.md
Last active February 11, 2025 17:12
Two ways to integrate Django with Jupyter (JupyterLab)

⚠️ This gist was the first time written in 2018. It was tested with django==2.2.x. It's likely to be relevant for the newer versions of django and jupyter, but I did't check that.

2023-03-15: checked it for python == 3.11, django == 4.1.7, jupyterlab = 3.6.1, django-extensions == 3.2.1, jupyter-server <= 2.0.0

Django_jupyter

Using Django project in Jupyter or JupyterLab

Method 1 (using shell_plus)

// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@timkpaine
timkpaine / iex.py
Last active December 9, 2022 19:46
Simple Real-Time Stock Streaming with Bokeh
'''
To run:
python -m bokeh serve iex.py
'''
import io
@heroheman
heroheman / ranger-cheatsheet.md
Last active March 15, 2026 20:23
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@machinaut
machinaut / rotate_euler.py
Last active April 1, 2019 13:56
Simple Euler Angles Rotation in python
import numpy as np
from scipy.linalg import expm
def rot_euler(v, xyz):
''' Rotate vector v (or array of vectors) by the euler angles xyz '''
# https://stackoverflow.com/questions/6802577/python-rotation-of-3d-vector
for theta, axis in zip(xyz, np.eye(3)):
v = np.dot(np.array(v), expm(np.cross(np.eye(3), axis*-theta)))
return v
@ertseyhan
ertseyhan / remount.sh
Created February 2, 2016 20:51
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."