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"}
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"}
curl -G https://api.github.com/search/repositories \ | |
--data-urlencode "q=stars:>1000" \ | |
--data-urlencode "sort=stars" \ | |
--data-urlencode "order=desc" \ | |
-H "Accept: application/vnd.github.preview" |
#!/usr/bin/python | |
# An interactive console for App Engine apps | |
# Usage: ./appengine_console.py app_id [host] | |
import code | |
import getpass | |
import sys | |
sys.path.append("/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine") |
.DS_Store | |
*.pyc | |
web | |
feedparser.py | |
sgmllib3.py |
$ 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) |
› 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 |
// Ensure you set the CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET, | |
// and CREATESEND_REDIRECT_URI environment variables for your registered | |
// OAuth application. | |
import static spark.Spark.*; | |
import spark.*; | |
import com.createsend.General; | |
import com.createsend.models.clients.ClientBasics; | |
import com.createsend.models.OAuthTokenDetails; | |
import com.createsend.util.AuthenticationDetails; |
<?php | |
# 1. Ensure you have Slim installed and in your include path. | |
# 2. Ensure you have createsend-php installed and in your include path. | |
# 3. Set CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET, | |
# and CREATESEND_REDIRECT_URI environment variables for | |
# your registered OAuth application. | |
require 'createsend/csrest_general.php'; | |
require 'Slim/Slim.php'; | |
\Slim\Slim::registerAutoloader(); |
web: python app.py |