Skip to content

Instantly share code, notes, and snippets.

View leixingyu's full-sized avatar
👋
Let's Connect!

Xingyu Lei leixingyu

👋
Let's Connect!
View GitHub Profile
@dfrankow
dfrankow / simple_server.py
Last active February 26, 2024 12:23
Simple HTTP REST server in python3
#!/usr/bin/env python
"""A simple HTTP server with REST and json for python 3.
addrecord takes utf8-encoded URL parameters
getrecord returns utf8-encoded json.
"""
import argparse
import json
@mottosso
mottosso / Dock.py
Last active October 13, 2023 09:01 — forked from liorbenhorin/Simple_MayaDockingClass.py
Simple way to dock Qt widgets to Maya 2017+
from maya import cmds, OpenMayaUI as omui
from Qt import QtWidgets, QtCore, QtCompat
def Dock(Widget, width=300, show=True):
"""Dock `Widget` into Maya
Arguments:
Widget (QWidget): Class
show (bool, optional): Whether to show the resulting dock once created
"""
Implements a simple HTTP/1.0 Server
"""
import socket
def handle_request(request):
"""Handles the HTTP request."""
@oglops
oglops / syncScriptEditor.py
Last active September 6, 2021 03:06
sync maya script editor tabs among multiple maya sessions
import re
import maya.cmds as mc
import maya.mel as mel
def get_optionvar(var, type='iv'):
pref_file = mc.internalVar(userPrefDir=1)+'userPrefs.mel'
values = []
with open(pref_file) as f:
for line in f.readlines():
@tyt2y3
tyt2y3 / chatroom.py
Created July 11, 2015 10:00
Simple chatroom in Python, upon BaseHTTPServer and long polling
'''
Simple chatroom
Reference
https://docs.python.org/2/library/threading.html
http://blog.oddbit.com/2013/11/23/long-polling-with-ja/
http://zulko.github.io/blog/2013/09/19/a-basic-example-of-threads-synchronization-in-python/
http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/
'''
@rxaviers
rxaviers / gist:7360908
Last active July 24, 2024 15:08
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: