Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / geonames-to-mongo.js
Created February 9, 2014 20:00
Simple NGA Geonames to Mongo Importer
var mongo = new Mongo(config);
var bulk = [];
mongo.initialize().then(function() {
return mongo.getCollection("geonames");
}).then(function(collection) {
var d = deferred();
var etl = new Etl();
etl.load("c:\\Downloads\\geonames_20140203.txt", {delimiter: "\t", columns: true, relax: true}).on('record', function(row, index) {
//console.log(JSON.stringify(row, null, 4));
@korczis
korczis / gist:9295189
Created March 1, 2014 18:54
Strange error
var g = null;
var msg = "";
var scaleValue = function(v, vMax) {
return v * vMax;
};
var tick = function() {
console.log("tick()");
@korczis
korczis / hooks.rb
Created March 19, 2014 10:16
Hopefully fixed
require 'gli'
require 'pp'
GoodData::CLI.module_eval do
pre do |global, command, options, args|
require 'logger'
GoodData.logger = Logger.new(STDOUT) if global[:l]
username = global[:username]
password = global[:password]
@korczis
korczis / project_list.rb
Created April 3, 2014 07:45
Example of project listing with ruby gem
#! /usr/bin/env ruby
require 'gooddata'
GoodData::logging_on
GoodData::logger.info 'Connecting ...'
c = GoodData.connect('svarovsky+gem_tester@gooddata.com', 'jindrisska')
GoodData::logger.info 'Connected ...'
@korczis
korczis / .travis.yml
Created April 3, 2014 09:25
Example of secure env variable usage (encrypted GD_PROJECT_TOKEN)
language: ruby
env:
- TEST_SUITE=test:unit
- secure: "eeUfQOhPwjvrUPd3hUzwDmj5PUGtAyBTbRusGtLeN7jSC0UgiYL3YxqN1qksgFSN9/81xw305VK4iAiZT7IrZ+8YvbtVLWcRwjPHfinaevAQsIDnmIQez0Y78VxyKsS8ekAW0J8Ux+GqCxrU1OBB+0x9jL2YiZaOI51OiUxEChc="
rvm:
- 1.9.3
- 2.1.0
- ruby-head
@korczis
korczis / yelp.json
Created April 20, 2014 23:49
Yelp microcrawling result example
{
"guid": "e7500c0a-8474-e57f-993b-5635ee97dbf7",
"url": "http://www.yelp.com/biz/bottega-louie-los-angeles",
"processor": "yelp.listing.details",
"data": {
"businessName": "Bottega Louie",
"detailUrl": "http://www.yelp.com/biz/bottega-louie-los-angeles",
"phoneNumber": 2138021470,
"reviews": {
"number": 78,
This file has been truncated, but you can view the full file.
{
"guid": "90a2c58c-e0d8-f054-2813-3a4dee999877",
"url": "http://www.yelp.com/biz/angelini-osteria-los-angeles",
"processor": "yelp.listing.details",
"data": {
"businessName": "Angelini Osteria",
"detailUrl": "http://www.yelp.com/biz/angelini-osteria-los-angeles",
"phoneNumber": 3232970070,
"reviews": {
"number": 0,
// Copyright, 2013-2014, by Tomas Korcak. <korczis@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@korczis
korczis / ApolloCrawlerVagrant.md
Last active August 29, 2015 14:00
List of stuff installed in ApolloCrawlerVagrant.md
tomaskorcak@kx-mac apollo-fat-box (master) $ vagrant destroy -f && vagrant up
WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
==> default: Running cleanup tasks for 'puppet' provisioner...
WARNING: Could not load IOV methods. Check your GSSAPI C library for an update
WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1