Skip to content

Instantly share code, notes, and snippets.

Me(19:26:20): Ok, I'm logged in
Me(19:26:33): My issue now is that I can't view my bill
Me(19:26:40): Can you look into why?
John(19:27:21): I show the following: This account is Suspended due to non-payment and access to email is blocked. Email access will be unblocked once the required payment is made.
Me(19:27:45): lol, how can I make payment if my access is blocked?
John(19:28:05): Normally, an account must be upgraded to Full Access in order to view the bill; however with that lock I can't tell if that is the case.
You should still be able to pay the bill, even with that lock.
Me(19:28:37): there's no place for me to make payment
Me(19:28:57): can you unlock so I can pay?
<!DOCTYPE html>
<html>
<head>
<title>Prototype</title>
<style>
h1 {
text-align: center;
}
#main_container {
def upload_locations
if params[:key] == '12345'
@locations = Location.active.order("locations.code")
stream = render_to_string(template: "locations/index", formats: [:xml])
Net::SFTP.start('host', 'user', password: 'pass') do |sftp|
sftp.file.open("locations.xml", "w") do |f|
f.puts stream
end
end
http://localhost:3001/locations/upload_locations?key=12345
GET /locations/upload_locations?key=12345 HTTP/1.1
Host: localhost:3001
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
If-None-Match: "7215ee9c7d9dc229d2921a40e899ec5f"
IMAGE: https://www.dropbox.com/s/90swuhnofjwheil/temp.png
#!/bin/env ruby
require 'rubygems'
require 'rtesseract'
mix_block = RTesseract::Mixed.new("temp.png") do |image|
image.area(85, 13, 80, 30)
end
puts mix_block.to_s
class FooController < ApplicationController
require 'rubygems'
require 'mechanize'
require 'open-uri'
def scrape
url = 'http://www.hotnewhiphop.com/archive/'
agent = Mechanize.new
page = agent.get(url)
render text: page.links.map(&:to_html).join("\n")
class Reports::Duplicates
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :run_time, :conditions, :matches
def initialize(attributes = {})
self.run_time = Time.now
attributes.each {|name, value| send("#{name}=", value)}
Module Utility
class << self
def to_time_with_zone(timezone, date, hour, minute)
old_time_zone = Time.zone
Time.zone = timezone
Time.zone.parse("#{date} #{hour}:#{minute}")
ensure
Time.zone = old_time_zone
end
end
class ConvertAgentNameToIds < ActiveRecord::Migration
TYPES = ['created', 'modified', 'cancelled']
def up
@agents = Hash[*User.select([:first_name, :last_name, :username]).map {|i| ["#{i.first_name} #{i.last_name}", i.username]}.flatten]
TYPES.each {|i| convert_agent(i)}
end
def down
@agents = Hash[*User.select([:first_name, :last_name, :username]).map {|i| [i.username, "#{i.first_name} #{i.last_name}"]}.flatten]
controller = $('body').data('controller')
action = $('body').data('action')
if controller is 'crs_reports' and action is 'booked_rates'