Skip to content

Instantly share code, notes, and snippets.

View dotpot's full-sized avatar

Lukas Šalkauskas dotpot

  • Vilnius, Lithuania
View GitHub Profile
@dotpot
dotpot / maximum_battery_life.md
Created March 20, 2012 05:09 — forked from mrflip/maximum_battery_life.md
maximum battery life checklist -- use before a long plane flight

Max Battery Life Checklist

Here is a checklist to follow if you want maximum battery life -- for instance if you're about to get on a long plane flight.

10 hour battery life on a non-SSD Macbook Pro 17"

Low power use checklist

With power connected:

@dotpot
dotpot / sc-dl.js
Created March 6, 2012 04:29 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@dotpot
dotpot / gist:1883672
Created February 22, 2012 09:47 — forked from randym/gist:1883637
# In a controller
document = db.Text(template.render('tpl/estimate.xls',template_values),encoding="utf_8")
self.response.headers.add_header('Content-disposition', 'attachment; filename="'+seq+'.xls"')
self.response.headers.add_header('Content-type', 'application/vnd.ms-excel; filename="'+seq+'.xls"')
self.response.headers.add_header('name', seq+'.xls')
self.response.out.write(document)