Skip to content

Instantly share code, notes, and snippets.

View NicolaiLolansen's full-sized avatar
💻
Doing work!

Nicolai Lolansen NicolaiLolansen

💻
Doing work!
View GitHub Profile
@juanpabloaj
juanpabloaj / logging_env.py
Last active March 1, 2024 13:09
python logging, log level with environment variable
import os
import logging
LOGLEVEL = os.environ.get('LOGLEVEL', 'INFO').upper()
logging.basicConfig(level=LOGLEVEL)
@DavidYKay
DavidYKay / simple_cb.py
Last active June 26, 2023 00:52
Simple color balance algorithm using Python 2.7.8 and OpenCV 2.4.10. Ported from: http://www.morethantechnical.com/2015/01/14/simplest-color-balance-with-opencv-wcode/
import cv2
import math
import numpy as np
import sys
def apply_mask(matrix, mask, fill_value):
masked = np.ma.array(matrix, mask=mask, fill_value=fill_value)
return masked.filled()
def apply_threshold(matrix, low_value, high_value):
@adrian
adrian / test-swift-cors.html
Created May 1, 2012 20:25
Swift CORS Javascript Example
<!DOCTYPE html>
<html>
<head>
<title>Test Swift CORS</title>
<!-- Only using jQuery for jQuery.parseJSON -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<div style="border: thin solid grey; padding-left: 10px; width: 50%; margin-left: auto; margin-right: auto">