Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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*") |
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: {} | |
} |
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, |
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 'rake' | |
require 'active_record' | |
require 'erb' | |
require 'yaml' | |
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [File.expand_path('db/migrate')] | |
module Rails | |
def self.env | |
'development' |
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 "matrix" | |
require "readline" | |
class ToyRobot | |
PROMPT = "> " | |
PLACE = /\APLACE\s+(\d+),(\d+),(NORTH|SOUTH|EAST|WEST)\z/ | |
COMMAND = /\ALEFT|RIGHT|MOVE|REPORT\z/ | |
QUIT = /\AQUIT\z/ | |
LEFT = Matrix[[0, 1], [-1, 0]] | |
RIGHT = Matrix[[0, -1], [ 1, 0]] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>FSM</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css" type="text/css"> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, Sans-Serif; | |
margin: 0; |