Skip to content

Instantly share code, notes, and snippets.

View bbrodriges's full-sized avatar

bbrodriges bbrodriges

View GitHub Profile
@bbrodriges
bbrodriges / gist:1868783
Created February 20, 2012 11:00
Вакансия "Веб-программист"
Обязанности:
* разработка сайтов, порталов, нестандартных решений для проектов, сервисов
* поддержка, модернизация существующих проектов
Требования:
* опыт работы программистом от 1 года.
* обязательные знание PHP, MySQL, HTML, CSS, JS, jQuery, основы ООП
* приветствуются знания: ООП, паттерны программирования, Google API, Яндекс API, FaceBook API, ВКонтакте API, навыки кроссбраузерной верстки, опыт работы с системами контроля версий, базовые знания Linux, опыт работы с популярными фреймворками.
* культура кода, соблюдение семантики
@bbrodriges
bbrodriges / gist:2145325
Created March 21, 2012 06:39
First project on continous.io
+ pip install -E /var/env_test -e git+git://github.com/continuous/unittest-continuous.git#egg=unittest-continuous
Hide command output (2 lines)
Usage: /var/env_test/bin/pip install [OPTIONS] PACKAGE_NAMES...
/var/env_test/bin/pip install: error: no such option: -E
@bbrodriges
bbrodriges / gist:2397845
Created April 16, 2012 11:16
Yandex.Maps http spoofer
#!/usr/bin/env python
import sys, os, gzip, zlib, StringIO, time, datetime, getopt, httplib, re, random
class pyagger:
""" Yandex Maps Spoofer (talks like an Android client) """
class mpoint:
@bbrodriges
bbrodriges / gist:2470549
Created April 23, 2012 12:11
sqlalchemy strange
# -*- coding: UTF-8 -*-
"""This module contains all methods to manipulate with database."""
#THIRD_PARTY MODULES
from sqlalchemy import *
#STANDART MODULES
import time
from hashlib import md5
@bbrodriges
bbrodriges / dbmeta.py
Created November 7, 2012 14:32
MySQL tables metadata
# Example (using Tornado database module)
# After init (e.g. db = Database()) you will get all meta info about tables stored in db.meta attribute
from tornado import database
class Database:
def __init__(self):
self.database = database.Connection('localhost', 'mydb', 'root', '12345')
@bbrodriges
bbrodriges / attrdict.py
Created November 14, 2012 06:43
Dictionary with key/values as attributes
class AttrDict(dict):
""" A dict that allows for object-like property access syntax. """
def __getattr__(self, name):
try:
return self[name]
except KeyError:
raise AttributeError(name)
@bbrodriges
bbrodriges / sort1mb.cpp
Created December 2, 2012 10:08 — forked from preshing/sort1mb.cpp
Sort one million 8-digit numbers in 1MB RAM
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef unsigned int u32;
typedef unsigned long long u64;
//-------------------------------------------------------------------------
// WorkArea
//-------------------------------------------------------------------------
@bbrodriges
bbrodriges / gist:4369042
Created December 24, 2012 12:08
Convert UNIX timestamp into human readable time delta. E.g.: 1356354501 -> "10 minutes ago"
def unix_to_delta(self, timestamp):
"""
@type timestamp int
@return str
Converts UNIX timestamp into human readable time delta.
E.g.: "10 minutes ago"
"""

Don't Buy the Snake Oil of Beamr Video

You might have heard of Beamr Video, and their impressive claims about reducing video bitrates by "up to 4x, without losing quality". Sounds too good to be true? Well, as a matter of fact, it is.

The Example Videos

The four example videos that Beamr has on their site use very high bitrates - 40-50 Mbps for 1080p video. These are the kind of bitrates you find on Blu-ray discs, whereas with something like Netflix's "SuperHD" you'd only get around ~5.6 Mbps (5800 kbps) 1080p video, and with 720p Netflix video the bitrate is only around ~3.5 Mbps (3600 kbps). If you have watched online streams like these, you'll probably know that they look quite decent. Now, if you look at the Beamr Video examples, you'll notice that even for their "reduced" clips, the bitrates are still around 9 Mbps minimum, and average as high as ~30 Mbps.

At this point, you can probably see the trick that Beamr is trying to pull

@bbrodriges
bbrodriges / gist:5583113
Last active December 17, 2015 08:49
Useful git shortcut
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
branch_name=${branch_name:-HEAD}
function gitacpp() { git add -A; git commit -m "$1" $2; git pull origin $branch_name; git push origin $branch_name; }