Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
import gdata.sites.client
import gdata.sites.data
# How to use the OAuth 2.0 client is described here:
# https://developers.google.com/api-client-library/python/guide/aaa_oauth
SCOPE = 'https://sites.google.com/feeds/'
#!/bin/sh
resolution=1360x720
seconds_per_day=0.01
auto_skip_seconds=0.1
elasticity=0.05
fps=25
bitrate=4000K
extension=webm
input=8bit.gource
@macbre
macbre / product.html
Last active August 29, 2015 14:12
Microdata
<title>Product - Microdata demo</title>
<body>
<article itemscope itemtype="http://data-vocabulary.org/Product">
<div class="shop" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><meta itemprop="title" content="Kamami">Sklep: <a href="http://elecena.pl/shop/kamami" itemprop="url">Kamami</a></div>
<span itemprop="brand">ACME</span>
<span itemprop="name">Executive Anvil</span>
<img itemprop="image" src="anvil_executive.jpg" />
@macbre
macbre / vcd2avi.sh
Last active August 29, 2015 14:11
VCD
mplayer vcd://2
mencoder vcd://2 -o file.avi -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000
@macbre
macbre / phantomjs2.md
Last active August 29, 2015 14:10
PhantomJS 2 build
require "rspec/core/formatters/base_text_formatter"
require 'headless'
require 'fileutils'
class AcceptanceVideoFormatter < RSpec::Core::Formatters::BaseTextFormatter
def initialize(output)
@headless = Headless.new(
video: {
nomouse: true,
@macbre
macbre / debian.md
Last active August 29, 2015 14:08
Debian @ Dell E7440
sudo apt-get -t wheezy-backports install xserver-xorg-video-intel
sudo apt-get install libva1 libva-intel-vaapi-driver vainfo
[     7.527] (II) Module intel: vendor="X.Org Foundation"
[     7.527]    compiled for 1.12.3.902, module version = 2.19.0
[     7.527]    Module class: X.Org Video Driver
[     7.527]    ABI class: X.Org Video Driver, version 12.1
@macbre
macbre / chrome-first-paint.js
Created October 21, 2014 20:40
Chrome's first paint timing
// first paint in chrome from https://github.com/addyosmani/timing.js
var hasFirstPaint = 0;
if (window.chrome && window.chrome.loadTimes) {
var paint = window.chrome.loadTimes().firstPaintTime * 1000;
var firstPaint = paint - (window.chrome.loadTimes().startLoadTime*1000);
var firstPaintLeft = (firstPaint / loaded)*100;
hasFirstPaint = 1;
}
@macbre
macbre / perfcap.js
Last active August 29, 2015 14:07 — forked from gleicon/perfcap.js
var page = require('webpage').create(),
MSG_SCREENSHOT = '123screenshot123';
page.onConsoleMessage = function(msg) {
if (msg === MSG_SCREENSHOT) {
page.render('screenshot.png');
phantom.exit()
}
console.log('INFO: ' + msg);
};