Skip to content

Instantly share code, notes, and snippets.

View anatol-grabowski's full-sized avatar

Anatol Grabowski anatol-grabowski

View GitHub Profile
@markjay4k
markjay4k / animated3Dplot.py
Last active April 24, 2024 00:13
animated 3D example using PyQtGraph and OpenGL
# -*- coding: utf-8 -*-
"""
Animated 3D sinc function
"""
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
import sys
@kushalvyas
kushalvyas / watch_video.js
Last active October 31, 2023 07:15
JS for Camera capture from browser
/**
* Created by kushal
*
* Usage :
* To access local system webcam on the internet/
* Couple of points to be remembered:
*
* - Accessing the webcam using HTML5 and JS requires permission from
* the browser. The url of the file has to be a valid one. Url such as file:/// in your browser will not permit the browser to access local webcam.
* - Whereas, an http or https url will surely make a paved way for it. Hence, while developing, one can use Xampp, Wamp or the LAMP Stack.
@gjreda
gjreda / gist:7433f5f70299610d9b6b
Last active April 11, 2023 16:23
pandas' read_csv parse_dates vs explicit date conversion
# When you're sure of the format, it's much quicker to explicitly convert your dates than use `parse_dates`
# Makes sense; was just surprised by the time difference.
import pandas as pd
from datetime import datetime
to_datetime = lambda d: datetime.strptime(d, '%m/%d/%Y %H:%M')
%time trips = pd.read_csv('data/divvy/Divvy_Trips_2013.csv', parse_dates=['starttime', 'stoptime'])
# CPU times: user 1min 29s, sys: 331 ms, total: 1min 29s
# Wall time: 1min 30s
@Artanis
Artanis / build.sh
Created September 17, 2011 08:43
Python C Extension Hello World
gcc -fpic --shared $(python-config --includes) greetmodule.c -o greetmodule.so