Skip to content

Instantly share code, notes, and snippets.

file_name = 'xxx-win.txt'
import codecs
BLOCKSIZE = 1048576 # or some other, desired size in bytes
with codecs.open(file_name, "r", "windows-1250") as sourceFile:
with codecs.open(file_name + 'utf', "w", "utf-8") as targetFile:
while True:
contents = sourceFile.read(BLOCKSIZE)
if not contents:

Template example

Install templating engine pip install jinja2.

Create files generate.py and template.html in the same directory.

After running python ./generate.py you should see file output.html with following content.

zzzz

Výpis posledních 100 řádku z minecraft logu

tail -n100 craftbukkit/logs/latest.log

Zjištění vytížení serveru

top

Odsud odejdeš pomocí Q.

@stlk
stlk / package.json
Created August 29, 2016 14:56
SASS compilation using webpack
{
"name": "cool-project",
"version": "1.0.0",
"description": "",
"main": "webpack.js",
"dependencies": {
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"html-webpack-plugin": "^2.22.0",
"sass-loader": "^4.0.0",
@stlk
stlk / script.md
Last active August 22, 2016 09:07
Update pyladies fork from upstream

Pridat odkaz na puvodni repository

git remote add upstream https://github.com/PyLadiesCZ/pyladies.cz.git

Stahnout zmeny

git fetch upstream

Prepnout se na svuj master

git checkout master

<!--
Misto tvuj@email.cz dej svuj email :)
-->
<form class="grid-form" method="post" action="https://formspree.io/tvuj@email.cz">
<div class="form-control narrow">
<label for="name">Jmeno</label>
<input name="name" id="name" type="text">
</div>
<div class="form-control narrow">
<label for="email">Email</label>

Keybase proof

I hereby claim:

  • I am stlk on github.
  • I am rousek (https://keybase.io/rousek) on keybase.
  • I have a public key whose fingerprint is 89D0 0A3C 4DD1 9A7F 7156 A6EC B0AD BB25 E56F F162

To claim this, I am signing this object:

@stlk
stlk / copy.ps1
Created August 17, 2014 19:46
copy file from one azure container to another
$srcUri = "http://something.blob.core.windows.net/vhds/something.vhd"
### Source Storage Account ###
$srcStorageAccount = "NAME"
$srcStorageKey = "KEY"
### Target Storage Account ###
$destStorageAccount = "NAME"
$destStorageKey = "KEY"
@stlk
stlk / rgb_spectrum.c
Created March 10, 2012 23:50 — forked from jimsynz/rgb_spectrum.c
Arduino sketch to cycle an RGB LED through the colour spectrum.
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
void setup() {
// Start off with the LED off.
setColourRgb(0,0,0);
}
void loop() {