Skip to content

Instantly share code, notes, and snippets.

@yosiat
yosiat / every
Created June 27, 2015 09:04
every
# Every
Write a function that accepts two arguments:
1. duration in milliseconds
2. array of objects that looks like this - { time: Date, value: int }
That returns an array of array of objects -> Array<Array<object>> whom partitioned by duration.
## Example
@yosiat
yosiat / line.html
Created April 19, 2015 17:38
LineChart nvd3 question
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="../build/nv.d3.css" rel="stylesheet" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.min.js" charset="utf-8"></script>
<script src="../build/nv.d3.js"></script>
<style>
text {
#!/bin/sh
<<DOCUMENTATION
Pack
-----
The idea for pack is to use devdocs in offline environment (without internet :( )
and in windows.
Pack steps:
1. We use the latest ruby installation available in windowws
@yosiat
yosiat / gist:84d4159e673442bcb91d
Created October 14, 2014 19:34
SetImediateMode returns Generic Error
package main
import (
"code.google.com/p/gopacket"
"code.google.com/p/gopacket/pcap"
"fmt"
)
func CreateInactiveHandle(pcapConfiguration PcapConfiguraiton) (*pcap.InactiveHandle, error) {
@yosiat
yosiat / designer.html
Created June 24, 2014 17:27
designer
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@yosiat
yosiat / designer.html
Created June 12, 2014 19:28
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../google-map/google-map-search.html">
<polymer-element name="my-element">
<template>
<style>
@yosiat
yosiat / designer.html
Created June 12, 2014 17:07
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@yosiat
yosiat / gist:8248304
Created January 3, 2014 22:57
XamarinCrashReport
Process: XamarinStudio [12766]
Path: /Applications/Xamarin Studio.app/Contents/MacOS/XamarinStudio
Identifier: com.xamarin.monodevelop
Version: 4.2.2.2 (4.2.2.2)
Code Type: X86 (Native)
Parent Process: launchd [241]
Responsible: XamarinStudio [12766]
User ID: 501
Date/Time: 2014-01-04 00:53:58.540 +0200
@yosiat
yosiat / replace_poc.js
Created December 3, 2013 20:44
crossfilter replace POC
function replace(newData) {
var nindex = crossfilter_range(newData.length);
// Update indexes.
removeDataListeners.forEach(function(l) {
l(nindex);
});
// Remove all matching records from groups.
@yosiat
yosiat / superclass.js
Last active December 20, 2015 15:08
superclass
// Removed toJSON, just for beautifying :)
/* CONSTRUCTOR -> */ function expression() {
};
Object.defineProperty(expression.prototype, "_type",
{
get : function(){