Skip to content

Instantly share code, notes, and snippets.

@veproza
veproza / setup.php
Last active August 25, 2018 19:50
TeamCity output including test duration for Nette Tester. Requires a custom Tester fork: https://github.com/veproza/tester (or just this commit: https://github.com/veproza/tester/commit/d3f4ad2c500d2b927eb372ec2be9b2f594bec9bc)
<?php
/**
* By jiripudil, https://github.com/jiripudil/intellij-nette-tester/blob/master/resources/setup.php
* @license https://github.com/jiripudil/intellij-nette-tester/blob/master/LICENSE.md
*/
use Tester\Runner\Runner;
final class TeamCityOutputHandler implements \Tester\Runner\StartAwareOutputHandler
{
@veproza
veproza / setup.php
Created August 25, 2018 19:35
A Setup.php file compatible with current (2.0) Nette Tester
<?php
/**
* By jiripudil, https://github.com/jiripudil/intellij-nette-tester/blob/master/resources/setup.php
* @license https://github.com/jiripudil/intellij-nette-tester/blob/master/LICENSE.md
*/
use Tester\Runner\Runner;
final class TeamCityOutputHandler implements \Tester\Runner\OutputHandler
{
@veproza
veproza / keybase.md
Created December 21, 2016 09:08
Keybase proof

Keybase proof

I hereby claim:

  • I am veproza on github.
  • I am marcelsulek (https://keybase.io/marcelsulek) on keybase.
  • I have a public key ASArTBEn22J62nv9EVwhcV9ribN8k9YzMCuBk7ZXLjs-Mgo

To claim this, I am signing this object:

@veproza
veproza / accelerometer.ino
Last active August 31, 2021 09:14
Accelerometer sampled at 1kHz, saved to SD card
// Based on MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include <Wire.h>
#include <TimerOne.h>
#include <SD.h>
#include <SPI.h>
@veproza
veproza / AGPS.md
Last active July 23, 2023 04:36
Getting u-blox MAX-7C GPS to work with Assisted A-GPS

Getting u-blox MAX-7C GPS to work with Assisted A-GPS

So you got your u-blox GPS and wired it up only to look at it struggling to get a valid fix? Under less than ideal conditions, it can take a better part of half an hour. That's because unlike your smartphone GPS, it doesn't have the luxury of having downloaded all the auxiliary navigation data (almanacs and the lot) out-of-band, via fast mobile connection. Instead it relies on the satellite's signal itself, which is being transmitted to you at meager 50 bits per second (I'm not missing "kilo" there, it's three orders of magnitude slower than your 2G GPRS connection).

Luckily, the u-blox receivers are fitted with what the company calls "AssistNow" capability and it does exactly the same thing your iPhone does - feeds the GPS with pre-downloaded almanacs, speeding up the acquisition process to mere seconds.

In principle, the process looks easy enough - we just need to download the data, and then push them to the receiver. Sadly, the AssistNow documentat

@veproza
veproza / seeker
Created August 16, 2014 21:12
Skript na samplovani disku po 0.5MB a sledovani, zda v samplu jsou same nuly (priblizne)
#!/bin/bash
for i in {0..1000000}
do
let skip=$i*1024
dd if=/dev/sdb count=1 skip=$skip | wc -w >> output
done
<html>
<head>
<title>My D3 Page</title>
<style>
svg {background: #aaa;}
</style>
</head>
<body>
<svg width='400' height='400'>
<circle cx="0" cy="0" r="0" stroke="black" stroke-width="3" fill="red" />
@veproza
veproza / Package.ls
Created November 12, 2013 16:27
Jednoduchá in-memory cache pro Node.js - Package a servisní třída pro HTTP request - Request
require! {
zlib
async
events.EventEmitter
}
module.exports = class Package extends EventEmitter
->
@type = "text/plain"
@lastModified = null
@content =