Skip to content

Instantly share code, notes, and snippets.

View Keegan-y's full-sized avatar

keegan Keegan-y

  • Shanghai, China
View GitHub Profile
@sanjeevsiva17
sanjeevsiva17 / printToPrinter.py
Created May 4, 2021 10:55
Create and send zpl file to printer
import os, sys
import subprocess
def printToPrnter(name, city):
data = "^XA" \
"^FO200,30^ADN,30,20^FB400,3,0,C^FD"+name+"^FS" \
"^FO200,80^ADN,30,20^FB400,3,0,C^FD"+city+"^FS" \
"^XZ"
try:
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': [
'django_filters.rest_framework.DjangoFilterBackend'
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework_simplejwt.authentication.JWTAuthentication',
],
}
@luminoso
luminoso / jupyter.sh
Last active August 1, 2023 13:55
base install jupyerlab datascience project
# CONDA
# create env
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --strict-channel-priority -n jupyter
conda activate jupyter
# jupyter, notebook and old notebook extensions
conda install -y jupyterlab
@lmyyao
lmyyao / sqlalchemy_bind_two_database.py
Created September 14, 2016 06:39
sqlalchemy bind multiple databases
from sqlalchemy import (String,
Integer,
engine_from_config,
Column)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base_1 = declarative_base()
Base_2 = declarative_base()
@somada141
somada141 / python_dicom_load_pydicom.md
Created March 2, 2015 10:30
Load DICOM data into a NumPy array with PyDICOM #python #dicom #medical #imagedata #pydicom #fileIO
@matteomattei
matteomattei / my.label
Last active April 23, 2023 08:56
Print labels with Dymo LabelWriter 450 using Python
<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
<PaperOrientation>Portrait</PaperOrientation>
<Id>Small30332</Id>
<PaperName>30332 1 in x 1 in</PaperName>
<DrawCommands>
<RoundRectangle X="0" Y="0" Width="1440" Height="1440" Rx="180" Ry="180" />
</DrawCommands>
<ObjectInfo>
<TextObject>