Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / geonames-to-mongo.js
Created Feb 9, 2014
Simple NGA Geonames to Mongo Importer
View geonames-to-mongo.js
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));
View gist:9295189
var g = null;
var msg = "";
var scaleValue = function(v, vMax) {
return v * vMax;
};
var tick = function() {
console.log("tick()");
@korczis
korczis / hooks.rb
Created Mar 19, 2014
Hopefully fixed
View hooks.rb
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 / .travis.yml
Created Apr 3, 2014
Example of secure env variable usage (encrypted GD_PROJECT_TOKEN)
View .travis.yml
language: ruby
env:
- TEST_SUITE=test:unit
- secure: "eeUfQOhPwjvrUPd3hUzwDmj5PUGtAyBTbRusGtLeN7jSC0UgiYL3YxqN1qksgFSN9/81xw305VK4iAiZT7IrZ+8YvbtVLWcRwjPHfinaevAQsIDnmIQez0Y78VxyKsS8ekAW0J8Ux+GqCxrU1OBB+0x9jL2YiZaOI51OiUxEChc="
rvm:
- 1.9.3
- 2.1.0
- ruby-head
@korczis
korczis / project_list.rb
Created Apr 3, 2014
Example of project listing with ruby gem
View project_list.rb
#! /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 / yelp.json
Created Apr 20, 2014
Yelp microcrawling result example
View yelp.json
{
"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,
View yelp-better-listing.json
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": {
View hacked-app.js
// 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 Aug 29, 2015
List of stuff installed in ApolloCrawlerVagrant.md
View ApolloCrawlerVagrant.md
View vagrant-up-output-example.txt
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