(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# Doesn't work | |
<p> | |
<% case @request.author_hosted %> | |
<% when "yes" %> | |
The school <b>has</b> hosted an author before. | |
<% when "no" %> | |
The school <b>has not</b> hosted an author before. | |
<% end %> | |
</p> |
# this was surprisingly difficult to find, the documentation and API is poor | |
require "net/http" | |
require "uri" | |
url = URI.parse("http://www.whatismyip.com/automation/n09230945.asp") | |
req = Net::HTTP::Get.new(url.path) | |
req.add_field("X-Forwarded-For", "0.0.0.0") | |
# For content type, you could also use content_type=(type, params={}) |
require 'minitest/mock' | |
require 'minitest/unit' | |
require 'date' | |
MiniTest::Unit.autorun | |
class TestMailPurge < MiniTest::Unit::TestCase | |
class MailPurge | |
def initialize(imap) | |
@imap = imap |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
http://diwis.imis.athena-innovation.gr:8181/sparql xxxxx | |
http://wiktionary.dbpedia.org/sparql wiktionary.dbpedia.org | |
http://wiktionary.dbpedia.org/sparql wiktionary.dbpedia.org | |
http://webconf.rkbexplorer.com/sparql webconf | |
http://minsky.gsi.dit.upm.es/semanticwiki/index.php/Special:SPARQLEndpoint vulnerapedia | |
http://services.data.gov.uk/transport/sparql transport.data.gov.uk | |
http://services.data.gov.uk/statistics/sparql statistics.data.gov.uk | |
http://roni.rkbexplorer.com/sparql roni | |
http://foreign.rkbexplorer.com/sparql rkb-explorer-foreign | |
http://services.data.gov.uk/research/sparql research.data.gov.uk |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
Install node-repl-promised:
npm install -g repl-promised
Use the repl to list all users
$ node-promised
> var app = require('./app');
undefined
> var Bookshelf = app.get('bookshelf');
undefined
This gist is dedicated to all of my fellow clueless n00bs who are frightened by the combination of [RSpec][1], [Capybara][2] and [Authlogic][3].
This gist will not tell you how to install Ruby, Rails, RSpec, Capybara or Authlogic. For the most part, you can install any of these by running either:
brew install <packagename>
bundle install <packagename>
At the point in time that you reach this gist, you should have all of them installed.
#!/bin/bash | |
#In early development, sometimes you've got a hand-built instance, but you also don't want to leave it up all the time | |
# We've got an m4xl instance running Spinnaker (http://spinnaker.io) but we only really need it during the day | |
# As a cost-saving measure, we shut it down overnight. However, we want it to be consistently accessible | |
# So this script is in a Jenkins job that runs every morning, | |
# starting up the instance then updating its DNS record to the new IP. | |
#If you have multiple DNS records for a single instance, | |
# you can safely run a second copy of the script with the ZONEID and RECORDSET updated appropriately. |