View truffleruby-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View activations_controller.rb
This file contains 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
class ActivationsController < ApplicationController | |
respond_to :json | |
def create | |
new_password = params[:user] && params[:user][:password] | |
token = params[:confirmation_token] | |
if !new_password | |
render_errors({"password"=>["can't be blank"]}.to_json) |
View anpr.rb
This file contains 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
formats = [ | |
"[A-Z]{2}[0-9]{2}[A-Z]{3}", | |
"[A-Z]{1}[0-9]{3}[A-Z]{3}", | |
"[A-Z]{3}[0-9]{3}[A-Z]{1}" | |
] | |
pattern = /\A#{formats.join("|")}\z/ | |
candidates = %w[ | |
RF10AK0 |
View welsh-constituencies.topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View welsh-regions.topojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View welsh-constituencies.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View welsh-regions.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View sonar.rb
This file contains 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 "openssl" | |
require "securerandom" | |
########################## | |
### iOS/Android Device ### | |
########################## | |
# Installation id - returned by the registration request | |
uuid = "E1D160C7-F6E8-48BC-8687-63C696D910CB" | |
uuid_bytes = uuid.scan(/[0-9A-Z]{2}/).map { |s| s.to_i(16) }.pack("C*") |
View markdown_helper.rb
This file contains 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
# app/helpers/markdown_helper.rb | |
require "redcarpet/render_strip" | |
module MarkdownHelper | |
HTML_DEFAULTS = { | |
escape_html: false, filter_html: false, | |
hard_wrap: true, xhtml: true, safe_links_only: true, | |
no_styles: true, no_images: true, no_links: false, | |
with_toc_data: false, prettify: false, link_attributes: {} | |
} |
View signals.json
This file contains 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
{ | |
"EXIT": 0, | |
"HUP": 1, | |
"INT": 2, | |
"QUIT": 3, | |
"ILL": 4, | |
"TRAP": 5, | |
"ABRT": 6, | |
"IOT": 6, | |
"FPE": 8, |
NewerOlder