This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MiqWebsocketWorker.delete_all | |
require_relative 'config/environment' | |
class MiqWebsocketWorker::Runner | |
def heartbeat | |
end | |
end | |
row = MiqWebsocketWorker.create_worker_record | |
guid = row.guid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PseudoColumns | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Specify the columns in {name => default_value} format | |
def pseudo_columns(columns = {}) | |
columns.each do |k, v| | |
define_method(k) do | |
attributes.fetch(__method__.to_s, v) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FulltextSearchable | |
extend ActiveSupport::Concern | |
included do | |
include Elasticsearch::Model | |
include Elasticsearch::Model::Callbacks | |
end | |
module ClassMethods | |
# Use this method to specify which columns you want to index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'ruby-progressbar' | |
BASEURL = "http://adatbank.sk/telepulesek/szlovakia-telepuleseinek-listaja" | |
db = [] | |
doc = Nokogiri::HTML(open(BASEURL)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage: phantomjs capture.js [width] [height] [url] [output] | |
*/ | |
var system = require('system'); | |
var args = system.args; | |
if (args.length === 5) { | |
var width = args[1]; | |
var height = args[2]; |
NewerOlder