Skip to content

Instantly share code, notes, and snippets.

View tomas789's full-sized avatar

Tomas Krejci tomas789

  • Ampiato.com
  • Czech Republic, Europe
View GitHub Profile
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@tomas789
tomas789 / README.md
Last active May 29, 2024 15:13
OpenCV <-> Objective-C++ (UIImage) conversion

OpenCV -> UIImage

cv::Mat mat /* = ... */;
UIImage* image = [UIImage fromCvMat:mat];

UIImage -> OpenCV

//
// PtGrayCamera.hpp
// PtGrey
//
#ifndef PtGrayCamera_hpp
#define PtGrayCamera_hpp
#include <dc1394/dc1394.h>
#include <stdexcept>

I would recommend Dask for this sort of work as it is easy to produce a task graph and minimise computation overhead

import dask


def A(argument):
    print('Running A with', argument)
    return argument