Skip to content

Instantly share code, notes, and snippets.

View mrakitin's full-sized avatar

Max Rakitin mrakitin

View GitHub Profile
@mrakitin
mrakitin / laptop_camera.py
Created February 6, 2018 04:05
Trigger laptop camera
import cv2
import matplotlib.pyplot as plt
class LaptopCamera:
def __init__(self, cam_id=0):
self.cam_id = cam_id
# There must be some "lazy" way to initialize it
self.cap = cv2.VideoCapture(cam_id)
self.cap.release()
@mrakitin
mrakitin / streaming_arrow.py
Created February 27, 2018 21:35 — forked from cpcloud/streaming_arrow.py
Streaming Arrow
import random
import time
from collections import deque
from threading import Thread
import zmq
import numpy as np
import pandas as pd

Keybase proof

I hereby claim:

  • I am mrakitin on github.
  • I am mrakitin (https://keybase.io/mrakitin) on keybase.
  • I have a public key ASCq44aRJAKRAJmSxGRHz8-wYzIs3bcOQK6hTENXKPXR8Ao

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
d = pd.read_html('http://www.espn.com/nfl/superbowl/history/winners', header=1)
scores = []
for s in d[0]['RESULT']:
parts = s.split(',')
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from bluesky.utils import install_kicker
from databroker import Broker
from ophyd.sim import det, motor
import matplotlib.pyplot as plt
plt.ion()
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from bluesky.utils import install_kicker
from databroker import Broker
from ophyd.sim import det, motor
import matplotlib.pyplot as plt
plt.ion()
"""
This was developed on 03/12/2020 during the ALS hackathon for the COSMIC beamline.
"""
from ophyd import PVPositioner, EpicsSignal, EpicsSignalRO, Component as Cpt
class ALSMotor(PVPositioner):
setpoint = Cpt(EpicsSignal, 'ao-MO:DVAL')
readback = Cpt(EpicsSignalRO, 'ai-MO:DRBV')
stop_signal = Cpt(EpicsSignal, 'bo-MO:STOP')
#!/bin/bash
set -e
bib_src="$HOME/Brookhaven National Laboratory/NSLS-II SUF AI-ML - Beamline Optimization/LAB-20-2261_BL-opt.bib"
xml_src="$HOME/Brookhaven National Laboratory/NSLS-II SUF AI-ML - Beamline Optimization/LAB-20-2261_BL-opt.xml"
xml_dest="$HOME/Library/Containers/com.microsoft.Word/Data/Library/Application Support/Microsoft/Office/Sources.xml"
binary="/Applications/JabRef.localized/JabRef.app/Contents/MacOS/JabRef"
# Convert .bib file to .xml:
# -*-ruby-*-
Vagrant.configure("2") do |config|
# From https://app.vagrantup.com/metaswitch-its/boxes/centos7-min-xfce
config.vm.box = "metaswitch-its/centos7-min-xfce"
config.vm.hostname = "um2020"
config.vm.network "private_network", ip: "10.10.10.10"
config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2
# Display the VirtualBox GUI when booting the machine