This file contains hidden or 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]; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| #!/bin/sh | |
| # gifcast - easily create gif screencasts from a selected area | |
| # | |
| # The first run lets you select a rectangle and starts recording while the second run stops the recording. | |
| # Tested on Fedora 24 with GNOME | |
| # Dependencies: xrectsel, byzanz, convert (ImageMagick) | |
| FILE="/run/user/${UID}/$(basename $0).pid" |
This file contains hidden or 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
| package semaphore | |
| import "sync" | |
| type Semaphore struct { | |
| Channel chan uint | |
| Mutex sync.Mutex | |
| } | |
| func New(size uint) *Semaphore { |
This file contains hidden or 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 'nokogiri' | |
| require 'open-uri' | |
| BASE = 'http://www.upn.gov.sk'.freeze | |
| url = "#{BASE}/utvary-stb-a-ps-na-slovensku/zoznam-osob.php?pismeno=".freeze | |
| agents = [] | |
| # Separate page for each letter |
This file contains hidden or 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
| #!/bin/env ruby | |
| # Script to approve a GitHub PR from the command line | |
| # | |
| # Usage: ./approve.rb <repo> <PR> | |
| # For auth configuration see: https://github.com/octokit/octokit.rb#using-a-netrc-file | |
| require 'octokit' | |
| require 'netrc' |
This file contains hidden or 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
| $('#submissionInstructionsHeader').remove(); | |
| $('#FwkErrorBeanId').remove(); | |
| $('#PreHeaderLayout').remove(); | |
| $('#DefaultFormName > table').remove(); | |
| $('#LLAOutput').remove(); | |
| $('#ConfirmationPgStackLayout tbody').children[1].remove(); |
OlderNewer