Skip to content

Instantly share code, notes, and snippets.

@tkafka
tkafka / peakdetect.py
Created January 17, 2012 23:10 — forked from sixtenbe/analytic_wfm.py
Peak detection in Python
import numpy as np
def peakdetect(y_axis, x_axis = None, lookahead = 500, delta = 0):
"""
Converted from/based on a MATLAB script at http://billauer.co.il/peakdet.html
Algorithm for detecting local maximas and minmias in a signal.
Discovers peaks by searching for values which are surrounded by lower
or larger values for maximas and minimas respectively
@tkafka
tkafka / gist:2038136
Created March 14, 2012 17:40
public ssh
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1sRxIdUKPpNar1u3PYpGuXS9JJ6gouOS/o6IB9UZ2GHed6nNKjXq4GzEn9wrx11oUDBDNx0e9khgTpYxVhMmcyY0Ujfx77+Yanl+RlBQY25znADFgkP5omjTPEDYaLGevZ2bCDQLqikqk7LK60DnKP7x1pbVPsWXURa0ZvJTwKy0lii93dC8+T7NSEzXDmgHDebzTUZI1MJAHwKBdf/jpEIXz+a5I3Qr4ZzNFUkgS7DCQ4xNX380RSNDTB2lpuR6/qw5cvo61P4skMNRpJrPHNsWmwKbirTzh+ur7Nxc5y7GkynSjPM3ZvKZSZT+OAsXGzDHgnvaOibTw5ubo60wJQ== tk@SAMSUNG
@tkafka
tkafka / dabblet.css
Created July 19, 2012 13:11
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: navy;
}
.btn, .btnOld {
display: inline-block;
<?php
use Nette\Diagnostics\Debugger,
Nette\Application\Routers\Route,
Nette\Application\Routers\RouteList,
Nette\Application\Routers\SimpleRouter;
// Load Nette Framework
require LIBS_DIR . '/Nette/loader.php';
@tkafka
tkafka / .htaccess
Created November 5, 2012 20:54
Nette 2 na Wedos
# enable cool URL
<IfModule mod_rewrite.c>
# FastCGI
SetEnv NETTE_HTACCESS ok
</IfModule>
http://www.behance.net/gallery/Facebook-New-Look-Concept/6504647
Good:
+ layouty kalendaru, hlavne horizontalni je zajimavy napad
+ graficke tema
Ugly:
- neni to jak cist kdyz si chci precist vsechno od posledniho checknuti FB, jednoznacny je jen linearni obsah ala super.cz (zejmena activity feed se dvema nezavislymi sloupci, budu nervozne tekat mezi atraktivnimi fotkami)
- prilis atraktivni fotky, text vypada nudne a nikdo by ho necetl
- schovane menu vpravo je clever, ne obvious
@tkafka
tkafka / gist:4610798
Created January 23, 2013 17:40
UXcamp 2013 FB like button - change 'changethis' in url for your nickname/twitter handle (only alphanumeric and '-', no spaces), and paste into HTML widget.
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fuxcamp.cz%2Fleden2013%2Fchangethis&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=80&amp;appId=203153213159064" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
@tkafka
tkafka / ui-faces.js
Last active December 15, 2015 02:29
List of avatars from http://uifaces.com by @calebogden - for mocking UIs
var UI_FACES = [
"http://uifaces.com/faces/_twitter/ShaunMoynihan_120.jpg",
"http://uifaces.com/faces/_twitter/blakesimkins_120.jpg",
"http://uifaces.com/faces/_twitter/nckjrvs_120.jpg",
"http://uifaces.com/faces/_twitter/cameronmoll_120.jpg",
"http://uifaces.com/faces/_twitter/timothycd_120.jpg",
"http://uifaces.com/faces/_twitter/jayrobinson_120.jpg",
"http://uifaces.com/faces/_twitter/damenleeturks_120.jpg",
"http://uifaces.com/faces/_twitter/danielhaim_120.jpg",
"http://uifaces.com/faces/_twitter/motherfuton_120.jpg",
@tkafka
tkafka / ringbuffer.h
Created December 7, 2013 23:10
OMG, ringbuffer in C macros :)
#include <stdlib.h>
#include <memory.h>
#include <malloc.h>
#ifndef _ringbuffer_h
#define _ringbuffer_h
// semantics: buffer goes from start to end-1, start == end -> empty or full, see 'full' flag
#define ringBuffer_typedef(T, NAME) \
typedef struct { \
(function($) {
// Add inner and outer width to zepto (adapted from https://gist.github.com/alanhogan/3935463)
var ioDim = function(dimension, includeBorder) {
return function (includeMargin) {
var sides, size, elem;
if (this) {
elem = this;
size = elem[dimension]();
sides = {
width: ["left", "right"],