Skip to content

Instantly share code, notes, and snippets.

View ppanyukov's full-sized avatar

Philip Panyukov ppanyukov

  • UK
View GitHub Profile
@ppanyukov
ppanyukov / rpi-run-ethernet-bridge.sh
Created June 21, 2016 14:37
Install and config of ethernet bridge on Raspberry Pi
#!/usr/bin/env bash
# Set up transparent bridge eth1->eth0
# - eth0 (built-in): attach to TT DSL router
# - eth1 (UBS) : attach to internal switch
#
# This should be executed at system startup.
# On Raspberry PI debian add this line to:
# /etc/rc.local:
# bash /path_to_this_file
package com.tttv.util
import scala.collection.mutable
/**
* NoBullshitJsonParser is a fast-as-you-can no-OO-bloatware-nonsense JSON
* parser for strings with one while loop in less than 200 lines of codez.
*
* It's totally non-compliant with strict JSON and is a work in progress.
*
Southpaw:~ philip$ export GOPATH="/Users/philip/scratch/gobook"; export PATH=${GOPATH}/bin:${PATH}
Southpaw:~ philip$ mkdir -p $GOPATH/src/hello
Southpaw:~ philip$ vi $GOPATH/src/hello/hello.go
// source:
package main
import (
"fmt"
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
/**
* aggregate_by_key_example demonstrates how to use aggregateByKey to sum up
* values by key and also keep the values themselves.
*
* Given the input:
*
* Seq(("001", 1), ("001", 2), ("001", 3), ("002", 0), ("002", 7))
package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
"time"
@ppanyukov
ppanyukov / bad.txt
Created August 7, 2015 11:30
BenchmarkDotNet Logs
Bad commit? 66cce477d016979cde3203d5f7125710cffdf4a4
NOTE: formatted the numbers in the table to make more readable
--------------
Target competition: Math_DoubleSqrtAvx
// ***** Competition: Start *****
// Found benchmarks:
// Math_DoubleSqrtAvx_Sqrt13_Throughput_X64_RyuJit_NET-Current -w=5 -t=10
@ppanyukov
ppanyukov / hadoop2
Created June 10, 2015 16:38
Make HDInsight Enumlator hadoop commands work with cygwin
#!/usr/bin/env bash
# A hack to make HDInsight Emulator work with cygwin bash.
# Basically, we don't use bash things which come with the installation.
# Instead, we call out to the Windows cmd scripts to invoke hadoop stuff.
cmd /c "hadoop" $*
@ppanyukov
ppanyukov / apple-wwdc14-video-hack.js
Last active August 29, 2015 14:06
Apple WWDC14 Video List hack
// A hacky script to work around that piece of crap WWDC14 page
// which does not have links to individual videos, not allows
// to have more than one video marked as active at the same time.
//
// Basically I went through the list of videos, picked those
// I think are relevant, make then "active", and then zap all
// the others.
//
// Simply copy/paste this into dev tools console.
//
@ppanyukov
ppanyukov / blah.cs
Created June 18, 2013 16:52
foobar
using Foo.Bar
public class Blah
{
}
@ppanyukov
ppanyukov / FooBar.cs
Created September 21, 2012 10:58
Cool way to create, embed, and structure tests
internal static class FooBar
{
private static void DoStuff()
{
}
private static class SelfTests
{
[TestFixture]