Skip to content

Instantly share code, notes, and snippets.

View MicTech's full-sized avatar
😎
make product people want

Michal Těhník MicTech

😎
make product people want
View GitHub Profile
@MicTech
MicTech / ndhk20121019
Created October 19, 2012 18:02
NerdDinner HK 2012.10.19
Lightning talks
SQUnit
https://github.com/Sqdw/SQUnit
The Reactive Extensions (Rx)
http://msdn.microsoft.com/en-us/data/gg577609.aspx
-----
@MicTech
MicTech / Splunk
Last active December 18, 2015 10:10
eval t=_time
- convert time information to epoch time
delta _time as diff
- return delta between events
@MicTech
MicTech / javaonubuntu
Last active December 26, 2015 20:49
Java on Ubuntu
[ubuntu-server] sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
java -version
➜ hadoop --version
Error: No command named `--version' was found. Perhaps you meant `hadoop -version'
➜ hadoop -version
Error: No command named `-version' was found. Perhaps you meant `hadoop version'
➜ hadoop version
Hadoop 2.2.0
@MicTech
MicTech / 0_reuse_code.js
Created March 19, 2014 13:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@MicTech
MicTech / script.sh
Last active August 29, 2015 13:58
Hadoop Pig playground
#resources
https://pig.apache.org/
http://hortonworks.com/hadoop-tutorial/how-to-use-basic-pig-commands/
http://engineering.linkedin.com/open-source/introducing-datafu-open-source-collection-useful-apache-pig-udfs
http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html
#terminal
hadoop dfs -copyFromLocal /tmp/NYSE_daily_prices_A.csv /NYSE_daily_prices_A.csv
###Following operation may not make sense for stack data, but I using them only for playing with Pig.
@MicTech
MicTech / Graph Databases
Last active August 29, 2015 14:00
Simplified Examples from Graph Databases
CREATE (shakespeare:Author { firstname: 'William', lastname: 'Shakespeare' }),
(juliusCaesar:Play { title: 'Julius Caesar' }),
(shakespeare)-[:WROTE_PLAY { year: 1599 }]->(juliusCaesar),
(theTempest:Play { title: 'The Tempest' }),
(shakespeare)-[:WROTE_PLAY { year: 1610}]->(theTempest),
(rsc:Company { name: 'RSC' }),
(production1:Production { name: 'Julius Caesar' }),
(rsc)-[:PRODUCED]->(production1),
(production1)-[:PRODUCTION_OF]->(juliusCaesar),
(performance1:Performance { date: 20120729 }),
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
@MicTech
MicTech / avroToCsv.pig
Last active February 11, 2016 08:13
Avro to Csv in Pig
#Based on Petr's code - https://github.com/PetrVales
#You need PiggyBank library
#info: https://cwiki.apache.org/confluence/display/PIG/PiggyBank
#jar: http://search.maven.org/#search%7Cga%7C1%7Cpiggybank
#start pig in local mode
pig -x local
#register PiggyBank library
@MicTech
MicTech / consumer_App1_1.xml
Created May 17, 2014 16:25
Resources for article about ActiveMQ VirtualTopics.
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.6" jmeter="2.11 r1554548">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>