Skip to content

Instantly share code, notes, and snippets.

@bernardoleary
bernardoleary / camera.py
Created February 17, 2019 22:56
Capture video feed and an image from camera
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
rgb = cv2.cvtColor(frame, cv2.COLOR_BGR2BGRA)
cv2.imshow('frame', rgb)
if cv2.waitKey(1) & 0xFF == ord('q'):
out = cv2.imwrite('capture.jpg', frame)
break
cap.release()
@bernardoleary
bernardoleary / update-gitignore.txt
Last active July 11, 2018 00:17
Remove files from git after adding/updating the .gitignore file
git rm -r --cached .
git add -A
git commit -am 'Removing ignored files'
USE [master]
GO
/****** Object: Database [InventoryDB] Script Date: 21/04/2018 4:54:35 AM ******/
CREATE DATABASE [InventoryDB]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'InventoryDB', FILENAME = N'/var/opt/mssql/data/InventoryDB.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'InventoryDB_log', FILENAME = N'/var/opt/mssql/data/InventoryDB_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO
@bernardoleary
bernardoleary / docker-kill-all.txt
Last active February 28, 2018 20:59
Stop all Docker containers
docker kill $(docker ps -q)