| Provider | IPv4 | IPv6 | DNS Over HTTPS | DNSSEC |
|---|---|---|---|---|
| CleanBrowsing |
|
|
https://doh.cleanbrowsing.org/doh/security-filter/ | Yes |
| Cloudflare |
|
|
https://1.1.1.1/dns-query | Yes |
| Google DNS |
|
|
https://dns.google.com/resolve | Yes |
| Hurricane Electric |
|
|
||
| Omnispring |
|
Yes | ||
| [Private Internet Access](https://helpdesk.privateinternetaccess.com/hc/en-us/articles/219460397-How-to-change-DNS-settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "open-uri" | |
| require "net/http" | |
| Error = Class.new(StandardError) | |
| DOWNLOAD_ERRORS = [ | |
| SocketError, | |
| OpenURI::HTTPError, | |
| RuntimeError, | |
| URI::InvalidURIError, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
Moved to git repository: https://github.com/denji/jetbrains-cleanup-backup
Quick uninstall JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
Quick backup JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-backup.sh | bash -s
Rails has a handy truncate helper (which is actually mostly a method added to String ), but it warns you it's not safe to use on html source, it'll cut off end tags and such.
What if you want an HTML safe one? There are a variety of suggested solutions you can google, none of which were quite robust/powerful enough for me.
So I started with my favorite, by Andrea Singh, using nokogiri.
But:
- I modified it to not monkey-patch Nokogiri, but be a static method instead (sadly making already confusing code yet more confusing, but I didn't want to monkey patch nokogiri)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Outputs this at warn log level: | |
| # 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]} | |
| # | |
| # Save as config/initializers/oneline_detailed_logging.rb. Consider | |
| # decreasing the log level from "info" to "warn" (in production.rb) so | |
| # the one-line log message replaces the standard request logs. | |
| # override process_action to add 2 things to the payload: | |
| # - remote IP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Order.class_eval do | |
| checkout_flow do | |
| go_to_state :address | |
| go_to_state :delivery | |
| go_to_state :payment, :if => lambda { payment_required? } | |
| go_to_state :confirm, :if => lambda { confirmation_required? } | |
| go_to_state :complete | |
| remove_transition :from => :delivery, :to => :confirm | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.1' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Setup | |
| # ===== | |
| # | |
| # Put this gist in Rails.root/config/initializers/cancan.rb | |
| # Add Squeel to Gemfile, see https://github.com/ernie/squeel | |
| # | |
| # gem "squeel", "~> 0.9.3" | |
| # | |
| # Load Squeel hash and symbol extensions in squeel config initializer | |
| # |
NewerOlder