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
| sudo su postgres | |
| psql -d template_postgis15 | |
| SELECT postgis_full_version(); | |
| \q | |
| exit |
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
| POSTGIS="1.5.1" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September 2009" LIBXML="2.7.7" USE_STATS |
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
| <?php | |
| /** | |
| * This class calls the bitly.pro RESTful API for our short domain wim.gs. It | |
| * provides shorten, info and stas calls. | |
| * | |
| * @link http://bit.ly/apidocs | |
| * @package urlShortener | |
| * @author Eric Boehs | |
| **/ |
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 Feed < ActiveRecord::Base | |
| def self.check_livescores(interval="30", duration="60") | |
| how_many = duration.to_i / interval.to_i | |
| @feeds = Feed.find(:all, :conditions => ['path LIKE ? OR path LIKE ?', '%livescores%', '%in-progress-boxscores%' ]) | |
| @feeds.each do |feed| | |
| how_many.times do |i| | |
| Delayed::Job.enqueue(AtomChecker.new(feed.id, :priority => 3), 4, (i*interval).seconds.from_now) | |
| end | |
| 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
| class Sale < ActiveRecord::Base | |
| belongs_to :user | |
| belongs_to :deal | |
| has_many :coupons | |
| end | |
| class Deal < ActiveRecord::Base | |
| has_many :sales |
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 | |
| ############################################################# | |
| # Lighter -- Campfire from the command line # | |
| # # | |
| # Installation: # | |
| # gem install tinder # | |
| # chmod +x lighter # | |
| # # | |
| # Usage: # |
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 'open-uri' | |
| require 'nokogiri' | |
| require 'cgi' | |
| require 'httparty' | |
| user_statuses = Hash.new | |
| file = "/tmp/xbox_live_user_statuses.yml" | |
| db = YAML::load(File.open(file)) if File::exists?(file) |
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
| # coding: utf-8 | |
| class String # This reopns the string class | |
| # Define a new method to convert the string to be url friendly | |
| def to_slug | |
| # This is the input as there are no arguments passed. | |
| string = self | |
| # Define which accents map to which ascii characters | |
| accents = { | |
| ['á','à','â','ä','ã','å'] => 'a', |
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
| # Define which accents map to which ascii characters | |
| accents = { | |
| 'A' => %w(À Á Â Ã Ā Ă Ȧ Ả Ä Å Ǎ Ȁ Ȃ Ą Ạ Ḁ Ầ Ấ Ẫ Ẩ Ằ Ắ Ẵ Ẳ Ǡ Ǟ Ǻ Ậ Ặ), | |
| 'AE' => %w(Æ Ǽ Ǣ), | |
| 'B' => %w(ḂƁ Ḅ Ḇ Ƃ Ƅ), | |
| 'C' => %w(C Ć Ĉ Ċ Č Ƈ Ç Ḉ), | |
| 'D' => %w(D Ḋ Ɗ Ḍ Ḏ Ḑ Ḓ Ď Đ Ɖ Ƌ), | |
| 'E' => %w(È É Ê Ẽ Ē Ĕ Ė Ë Ẻ Ě Ȅ Ȇ Ẹ Ȩ Ę Ḙ Ḛ Ề Ế Ễ Ể Ḕ Ḗ Ệ Ḝ Ǝ Ɛ), | |
| 'F' => %w(Ḟ Ƒ), | |
| 'G' => %w(Ǵ Ĝ Ḡ Ğ Ġ Ǧ Ɠ Ģ Ǥ), |
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
| // Author: Eric Boehs | |
| // Description: Submits a GET request using jQuery's AJAX lib to conferences/search.js. | |
| // It expects an html response of the <li> elements of each conference object | |
| // It will populate the ul.search-results element with the response | |
| // Created: February 20th, 2011 | |
| // Version: 0.01 | |
| // BUG: There's a horrible bug in this version: Searches are commonly left blank even though | |
| // there may be results due to the throttling I built in. Pressing an enter at the end of the | |
| // search fixes it. I thought about doing a loop check to search again if they I haven't seen a | |
| // a keypress in >500ms or something. But then I thought I should go to bed. |