Skip to content

Instantly share code, notes, and snippets.

View bigfleet's full-sized avatar

Jim Van Fleet bigfleet

View GitHub Profile
@bigfleet
bigfleet / tulsa.rb
Last active October 13, 2015 11:09 — forked from jdungan/tulsa-fire-dispatches.rb
Translator for tulsa dataportal
Publisher.create! do |pub|
pub.title = "Fire Dispatches"
pub.endpoint = "https://citygram-services.herokuapp.com/tulsa-fire-dispatch"
pub.active = true
pub.visible = false
pub.city = "Tulsa"
pub.icon = "fire-calls.png"
pub.state = "OK"
pub.description = "Recent Tulsa Fire Department Dispatches."
pub.tags = ["tulsa"]
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001
From: Ilya Grigorik <ilya@igvita.com>
Date: Thu, 10 Jun 2010 00:46:48 -0400
Subject: [PATCH] async rails3
---
Gemfile | 6 ++++++
app/controllers/widgets_controller.rb | 6 ++++++
app/models/widget.rb | 2 ++
config.ru | 1 +
STDOUT.sync = true
require 'queue'
start_time = Time.now.to_i
msg = 0
queue = Queue.new("testing")
queue.subscribe do |obj|
msg += 1

Privacy Policy

Last revised on [DATE]

The Gist

Work Montage, Inc. ("Work Montage") makes available services include our web sites (http://workmontage.com/ and http://mocksup.com/), our blog, and any other software, sites, and services offered by Work Montage in connection to any of those (taken together, the "Service"). It is Work Montage's policy to respect your privacy regarding any information we may collect while operating our websites.

Work Montage will collect certain non-personal information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

Terms of Service

Last revised on [DATE]

The Gist

Work Montage, LLC operates the Mocksup service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.

For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.

Bluepill.define_process_condition(:running_time) do
def initialize(options = {})
@below = options[:below]
end
def run(pid)
started = `ps -p #{pid} -o command`.match(/since (\d+)/)[1].to_i
Time.now - Time.at(started)
rescue
0
nkallen_: nkallen_: anyway, i want to stress that we basically agree about things so i want to be sure that the tone of the blog post is such
[7:25pm] nkallen_: [7:17pm] nkallen_: i would argue that what you do in rails 3 (according to these tweets I've read)
[7:25pm] nkallen_: [7:17pm] nkallen_: is exactly what I propose... this is just how one might do it in Ruby
[7:25pm] nkallen_: [7:18pm] nkallen_: but my point is conceptual and not about ruby
[7:25pm] nkallen_: [7:18pm] nkallen_: it applies to every oo language and also I might argue to functional languages
[7:25pm] nkallen_: [7:18pm] nkallen_: which is to structure a program around the ability to layer on enhanced functionality and ensure that no assumptions are hardcoded by abstracting over the manufacture of objects
[7:25pm] nkallen_: [7:19pm] nkallen_: in the literature, these techniques are called DI, decorators, and factories.
[7:25pm] nkallen_: [7:20pm] nkallen_: i like these terms because they reflect the concepts that are at work. because ruby m
When /^(.*) in the "([^\"]*)" section$/ do |action, title|
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
end
When /^(.*) in the "([^\"]*)" row$/ do |action, title|
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end