Skip to content

Instantly share code, notes, and snippets.

View wwj718's full-sized avatar

wwj718

View GitHub Profile
version: '3'
services:
postgres:
image: postgres:9.4-alpine
volumes:
- ./pgdata_new:/var/lib/postgresql/data
ports:
- '127.0.0.1:5432:5432'
elasticsearch:
#image: wwj2
@StefanD986
StefanD986 / BluetoothLowEnergy.py
Last active June 15, 2023 05:01
QBluetooth Discovery Methods in pyqt
import PyQt5
from PyQt5 import QtCore
from PyQt5 import QtBluetooth
class DeviceFinder(QtCore.QObject):
def __init__(self):
super().__init__()
self.m_devices = []
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 16, 2024 17:37
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@wwj718
wwj718 / client.py
Created March 24, 2017 11:37 — forked from marvin/client.py
simple python client/server socket binary stream
import socket
HOST = 'localhost'
PORT = 9876
ADDR = (HOST,PORT)
BUFSIZE = 4096
videofile = "videos/royalty-free_footage_wien_18_640x360.mp4"
bytes = open(videofile).read()
@sgoblin
sgoblin / rhubarbot.py
Created December 22, 2016 21:00
JimTheBot from rhubarb.sgoblin.com
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
import websocket
from time import sleep
import json
# Insert database name here
db_name="jimdb"
# Insert valid database URI here
@littlecodersh
littlecodersh / flask_qr.py
Created December 5, 2016 01:22
A demo of how to show itchat qrcode through website.
import threading
from flask import Flask, make_response
import itchat
qrSource = ''
def start_flask():
flaskApp = Flask('itchat')
@flaskApp.route('/')
@MightyPork
MightyPork / usb_hid_keys.h
Last active April 17, 2024 19:25
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@marians
marians / CouchDB_Python.md
Last active April 9, 2024 12:21
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@lars-tiede
lars-tiede / asyncio_loops.py
Last active April 3, 2024 15:28
asyncio + multithreading: one asyncio event loop per thread
import asyncio
import threading
import random
def thr(i):
# we need to create a new loop for the thread, and set it as the 'default'
# loop that will be returned by calls to asyncio.get_event_loop() from this
# thread.
loop = asyncio.new_event_loop()