Skip to content

Instantly share code, notes, and snippets.

@stlk
stlk / lampa_barvy.ino
Last active January 22, 2018 14:16
my cool description
#include <Adafruit_NeoPixel.h>
#define PIN 1
#define WAIT 40
Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.setBrightness(255);
#include <Adafruit_NeoPixel.h>
#define PIN 1
#define WAIT 40
// pouzivame knihovnu Adafruit_NeoPixel pro komunikaci s diodou
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// Zakladni nastaveni diody
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 [email protected] dej svuj email :)
-->
<form class="grid-form" method="post" action="https://formspree.io/[email protected]">
<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: