Skip to content

Instantly share code, notes, and snippets.

View cmdelatorre's full-sized avatar
:octocat:
Litox

Carlos de la Torre cmdelatorre

:octocat:
Litox
View GitHub Profile
@Asymptote
Asymptote / Python 3.4+ with OpenCV 3.1.0 Binding on Ubuntu 14.04
Created May 29, 2016 11:27
Python 3.4+ with OpenCV 3.1.0 Binding on Ubuntu 14.04
# I have followed PyImageSearch tutorial http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
# Ubuntu upgrade & update current libraries
sudo apt-get update
sudo apt-get upgrade
# Install dependancies
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
@ClementC
ClementC / print_cm.py
Last active September 5, 2017 07:08 — forked from zachguo/print_cm.py
from sklearn.metrics import confusion_matrix
def print_cm(cm, labels):
"""pretty print for confusion matrixes"""
columnwidth = max([len(x) for x in labels])
# Print header
print(" " * columnwidth, end="\t")
for label in labels:
print("%{0}s".format(columnwidth) % label, end="\t")
print()
@vergissberlin
vergissberlin / rst2html.css
Last active January 3, 2018 02:55
Documentation: Create GitHub like styled html doc file with rst2html
/**
* :Author: Chad Skeeters
* :Contact: cskeeters@nciinc.com
* Stylesheet for use with Docutils/rst2html.
* Example: rst2html --stylesheet=rst2html.css README.rst doc/html/README.html
*/
html {
font-size: 100%;
-webkit-text-size-adjust: 100%;
@burtyish
burtyish / django-pageable-collection.coffee
Last active August 29, 2015 13:58
An extension of Backbone.PageableCollection to parse server responses created by Django Rest Framework.
define [
'jquery',
'underscore',
'backbone',
'backbone-pageable'
], ($, _, Backbone) ->
###
An extension of Backbone.PageableCollection to parse server responses created by Django Rest Framework.
The response structure is expected to match that provided by django-rest-framework's Pagination mechanism
@mwhite
mwhite / git-aliases.md
Last active April 22, 2024 09:22
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@mminer
mminer / jsonhandler.py
Created April 26, 2013 02:36
A JSON request handler for Tornado.
import json
import tornado.web
class JsonHandler(BaseHandler):
"""Request handler where requests and responses speak JSON."""
def prepare(self):
# Incorporate request JSON into arguments dictionary.
if self.request.body:
try:
@jgomezdans
jgomezdans / random.py
Created May 15, 2010 23:24
Random colormap for matplotli
import matplotlib,numpy
import pylab
# A random colormap for matplotlib
cmap = matplotlib.colors.ListedColormap ( numpy.random.rand ( 256,3))
pylab.imshow ( Z, cmap = cmap)
pylab.show()