Skip to content

Instantly share code, notes, and snippets.

View danhawkins's full-sized avatar

Danny Hawkins danhawkins

View GitHub Profile
@danhawkins
danhawkins / README.md
Created December 20, 2016 19:14 — forked from davejlong/README.md
Forecast widget and job for Kitto

Forecast Widget and Job Powered By Forecast.io

This package includes a job to pull forecasts from the Forecast.io API and a widget to display the forecast information.

Install

  1. Install into your dashboard with mix kitto.install --gist 229b76b15eae45ee9f5cc1e5d62a40eb
  2. Register for a DarkSky API key and set it into your applications environment in config/config.exs:
@danhawkins
danhawkins / signal_catching.rb
Created April 29, 2016 19:18 — forked from sauloperez/signal_catching.rb
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {