Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('images/gomel.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret,thresh = cv2.threshold(gray,127,255,1)
contours,h = cv2.findContours(thresh,1,2)
for cnt in contours:
cv2.drawContours(img,[cnt],0,(0,0,255),1)
@vood
vood / keybase.md
Created March 8, 2018 20:03
keybase.md

Keybase proof

I hereby claim:

  • I am vood on github.
  • I am avysotsky (https://keybase.io/avysotsky) on keybase.
  • I have a public key ASCEwddvxCaWbWMrWusHLdj-LLPAztzpH0qJJPTr-45a3go

To claim this, I am signing this object:

@vood
vood / example.py
Created October 17, 2017 19:01
Leveraging concurrent execution in python
import aiohttp
import time
import asyncio
async def call_url(url):
print('Starting {}'.format(url))
async with aiohttp.ClientSession() as session:
appdirs==1.4.3
appnope==0.1.0
backports-abc==0.5
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.5.0.1
certifi==2017.1.23
clearbit==0.1.4
click==6.6
contextlib2==0.5.4
Cython==0.24
@vood
vood / build.sh
Last active April 24, 2016 20:06
#!/usr/sh -e
#clone our private github repo with Xamarin project
git clone git@github.com/our_xamarin_project.git
cd our_xamarin_project
#update homebrew
brew update
#install Xamarin.Studio, Xamarin.iOS, Xamarin.Android, Mono
brew cask install xamarin-mdk xamarin-ios xamarin-studio xamarin-android
#install nuget dependencies
@vood
vood / xhprof.php
Created June 24, 2015 03:10
AWS Elasticbeanstalk Xhprof Config
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
register_shutdown_function(function() {
$xhprof_data = xhprof_disable();
$XHPROF_ROOT = "/root/pear/php";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
@vood
vood / delete-old-elasticbeanstalk-app-versions.php
Last active August 29, 2015 14:22
Script for deleting last `l` application versions from the `a` application on ElasticBeanstalk
<?php
use Aws\ElasticBeanstalk\ElasticBeanstalkClient;
require_once __DIR__ . '/vendor/autoload.php';
$bs = new ElasticBeanstalkClient([
'version' => 'latest',
'region' => 'us-east-1'
]);
@vood
vood / upload.php
Created April 4, 2014 18:05
Upload files to SugarCRM
<?php
//UploadStream wrapper will take care of putting the file in correct dirrectory
file_put_contents('upload://example.txt', $data);
//the same works when you want to read the file
file_get_contents('upload://example.txt');
//More info here
//@see /sugarcrm/include/upload_file.php
//@see http://www.php.net/manual/en/class.streamwrapper.php
@vood
vood / saml_issues.php
Created April 2, 2014 00:59
SAML issues findings
<?php
//sugarcrm/custom/modules/Users/Authenticate.php
//replace
$authController = new CustomAuthenticationController();
//with
$authController = new CustomAuthenticationController::getInstance();
//sugarcrm/custom/modules/Users/authentication/CustomSAMLAuthenticate/CustomSAMLAuthenticateUser.php
//SamlResponse has been replaced with OneLogin_Saml_Response class
$samlresponse = new SamlResponse(get_saml_settings(), $_POST['SAMLResponse']);
//@see sugarcrm/modules/Users/authentication/SAMLAuthenticate/SAMLAuthenticateUser.php
@vood
vood / example.php
Last active August 29, 2015 13:57
Custom config.js
<?php
// custom/include/MVC/View/views/view.sidecar.php
class CustomViewSidecar extends ViewSidecar {
public function preDisplay() {
if(!file_exists($this->configFile)) {
CustomModuleInstaller::handleBaseConfig();
}
parent::preDisplay();
}