Skip to content

Instantly share code, notes, and snippets.

View geekloper's full-sized avatar

Abdellah derfoufi geekloper

View GitHub Profile
@brunobuddy
brunobuddy / validateRegistrationNumber.ts
Created June 8, 2018 09:50
TypeScript SIRET Validation Script (French company registration number)
// Returns true if valid, false if not. Note that registrationNumber param is a string (usually provided by HTML imput)
validateRegistrationNumber(registrationNumber: string): boolean {
if (registrationNumber.length !== 14) {
return false
}
let sum = 0
let digit: number
for (let i = 0; i < registrationNumber.length; i++) {
if (i % 2 === 0) {
digit = parseInt(registrationNumber.charAt(i), 10) * 2
@allskyee
allskyee / opencv_webcam_multithread.py
Last active December 7, 2022 15:59
opencv python camera frame grab and display on different threads with safe synchronization
#!/usr/bin/env python
from threading import Thread, Lock
import cv2
class WebcamVideoStream :
def __init__(self, src = 0, width = 320, height = 240) :
self.stream = cv2.VideoCapture(src)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
self.stream.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active April 23, 2024 13:04
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@gbuesing
gbuesing / ml-ruby.md
Last active February 28, 2024 15:13
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems