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
| def self.poll(array_of_ips) | |
| EM.synchrony do | |
| snmps = array_of_ips.collect {|x| SNMP4EM::Manager.new(:host => x, :version => :SNMPv1)} #, :port => 4444 | |
| concurrency = 50 | |
| @start_time = Time.now | |
| EM::Synchrony::Iterator.new(snmps, concurrency).map do |snmp, iter| | |
| request = snmp.get([OID_SYSDESC,OID_OID]) |
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
| $list->setOrdered(true); | |
| if (isset($_GET['allkills']) && $_GET['allkills'] == 0 ) { | |
| $list->setAPIKill(); | |
| $list->setOrderBy(' kll.kll_external_id ASC '); | |
| } else { | |
| $list->setOrderBy(' kll.kll_id ASC '); | |
| } | |
| if (isset($_GET['limit'])) { | |
| $list->setLimit(min($maxkillsreturned, (int)$_GET['limit'])); | |
| } else { |
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
| class Alliance | |
| include Mongoid::Document | |
| field :name, :type => String | |
| field :eve_reference, :type => Integer | |
| embeds_many :kills | |
| def initial_kill_hash | |
| initial_kills = Hash.from_xml(open("http://eve-kill.net/?a=idfeed&alliance=#{self.eve_reference}&startdate=#{1.year.ago.to_i}")) | |
| create_kills_from_hash(initial_kills) | |
| 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
| {"geometry":{"type":"Polygon","coordinates":[[[-84.820305,38.403423],[-84.820305,42.327132],[-80.518454,42.327132],[-80.518454,38.403423],[-84.820305,38.403423]]]},"country":"United States","bounding_box":{"type":"Polygon","coordinates":[[[-84.820305,38.403423],[-80.518454,38.403423],[-80.518454,42.327132],[-84.820305,42.327132]]]},"polylines":["ktkiFzmudOej\u007DV??qegYdj\u007DV??pegY"],"name":"Ohio","attributes":{"162813:id":"OH","162772:state_id":"39","189390:id":"ohio"},"full_name":"Ohio, US","country_code":"US","url":"http:\/\/api.twitter.com\/1\/geo\/id\/de599025180e2ee7.json","place_type":"admin","contained_within":[{"country":"United States","bounding_box":null,"name":"United States","attributes":{},"full_name":"United States","country_code":"US","url":"http:\/\/api.twitter.com\/1\/geo\/id\/96683cc9126741d1.json","place_type":"country","id":"96683cc9126741d1"}],"id":"de599025180e2ee7"} |
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
| <?xml version="1.0"?> | |
| <datacollection-group name="Isilon"> | |
| <resourceType name="isiProtocolName" label="Isilon Node Traffic by Protocol" resourceLabel="${protocolName} Stats"> | |
| <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/> | |
| <storageStrategy class="org.opennms.netmgt.dao.support.IndexStorageStrategy"/> | |
| </resourceType> | |
| <resourceType name="isiDiskPerfBay" label="Isilon Node Disk Bays" resourceLabel="Disk ${deviceName}"> | |
| <persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/> | |
| <storageStrategy class="org.opennms.netmgt.dao.support.IndexStorageStrategy"/> |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'feedzirra' | |
| require 'open-uri' | |
| def item_prices(parsed_feed, number_to_display) | |
| prices = parsed_feed.entries[1..number_to_display].collect {|x| x.summary.scan(/itemPrice:\'(\d{1,}\.\d{2})/)}.collect {|x| x.flatten} |
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
| Bundler.require(:default) | |
| require 'open-uri' | |
| require 'net/http' | |
| require "em-synchrony" | |
| require "em-synchrony/em-http" | |
| require 'em-synchrony/fiber_iterator' | |
| class KisamaDownloader | |
| attr_reader :url, :live_thread, :images |
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
| #!/usr/bin/env ruby | |
| def discard_x_frames(number) | |
| files = Dir.glob('*.jpg') | |
| files.in_groups_of(number + 1).each do |files| | |
| files[1..-1].each do |file| | |
| File.unlink(file) | |
| end | |
| 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
| require 'json' | |
| require 'net/http' | |
| require 'time' | |
| class Chanpi | |
| attr_accessor :url, :posts, :http_resp_code, :last_modified | |
| attr_reader :board, :html_uri | |
| def initialize(json_url) | |
| @url = json_url | |
| @board = URI(json_url).path.split('/')[1] |
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
| class Profile | |
| include Gmaps4rails::ActsAsGmappable | |
| include Mongoid::Document | |
| include Mongoid::Timestamps | |
| include Mongoid::Geospatial | |
| # include Mongoid::Spacial::Document | |
| field :name, :type => String, :default => 'Anonymous Narwhal' | |
| field :headline, :type => String, :default => "I couldn't be bothered with a headline." |