Easily get Rails controller and action from a route:
irb(main):001:0> Rails.application.routes.recognize_path "/github/github/issues", method: "GET"
=> {:controller=>"issues", :action=>"index", :user_id=>"github", :repository=>"github"}
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>animation test</title> | |
<style> | |
body { | |
text-align: center; | |
font-family: 'Courier New', Courier, monospace; | |
} |
auth_options = { | |
bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" | |
} | |
ssl_options = { | |
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | |
} | |
control_client = Kubeclient::Client.new \ | |
"https://kubernetes.default.svc", |
Easily get Rails controller and action from a route:
irb(main):001:0> Rails.application.routes.recognize_path "/github/github/issues", method: "GET"
=> {:controller=>"issues", :action=>"index", :user_id=>"github", :repository=>"github"}
#!/bin/bash | |
# Export USERNAME, PASSWORD, and REPORT_URL | |
# REPORT_URL should look something like https://my.ghe/stafftools/reports/all_users.csv | |
# See: https://help.github.com/enterprise/admin/articles/site-admin-dashboard/#reports | |
set -e | |
for i in $(seq 1 5); do | |
echo "Trying to get report..." | |
result=$(curl -s -L -u $USERNAME:$PASSWORD $REPORT_URL) |
$ script/scrape enschede | |
===> Scraping Buienalarm.nl... | |
Projected rainfall for the next two hours in enschede: | |
18:40 - 0.05mm/hour (light) | |
18:45 - 0.05mm/hour (light) | |
18:50 - 0.09mm/hour (light) | |
18:55 - 0.11mm/hour (light) | |
19:00 - 0.13mm/hour (light) |
A request to http://www.buienalarm.nl/location/rotterdam produces a chart that shows the projected rainfall for the next two hours in Rotterdam:
That page includes the following JavaScript that represents the data used to build the chart:
<script type="text/javascript">
I hereby claim:
To claim this, I am signing this object:
source "https://rubygems.org" | |
gem "octokit" |
› curl -Is https://api.github.com/repos/rails/rails/issues | grep Link | |
Link: <https://api.github.com/repositories/8514/issues?page=2>; rel="next", <https://api.github.com/repositories/8514/issues?page=26>; rel="last" | |
Access-Control-Expose-Headers: ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes |