- What/Why JSON schema
- Apply to rails model validation
- Test your API endpoint with schema matcher
- Homework for a curious reader
- References
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
en: | |
letter_closings: | |
- Adios | |
- All best wishes | |
- All best, always | |
- Always in my thoughts | |
- As always, with affection | |
- Be good | |
- Be well | |
- Best Regards |
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
// Run on https://www.youtube.com/user/foobar/playlists?view=1&shelf_id=0&sort=dd | |
function getParents(el, parentSelector /* optional */) { | |
// If no parentSelector defined will bubble up all the way to *document* | |
if (parentSelector === undefined) { | |
parentSelector = document; | |
} | |
var parents = []; |
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
pragma solidity ^0.4.20; | |
interface FoodSafety { | |
function owner | |
function transfer | |
function split | |
I hereby claim:
- I am hadees on github.
- I am hadees (https://keybase.io/hadees) on keybase.
- I have a public key whose fingerprint is A0C1 850A 15D1 1F77 DA03 94F3 367E 21AD A895 8278
To claim this, I am signing this object:
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 BooleanValue | |
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/column.rb#L8 | |
FALSE_VALUES = [false, 0, "0", "f", "F", "false", "FALSE", "off", "OFF"] | |
def self.convert(value) | |
Rails.present? ? with_rails(value) : without_rails(value) | |
end | |
private |
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
<% module_namespacing do -%> | |
class <%= class_name %> < <%= parent_class_name.classify %> | |
### Default Scope | |
### Includes and Extensions | |
### Constants | |
### Virtual 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
$ youtube-dl --autonumber-size 3 --restrict-filenames -o "S01E%(autonumber)s-%(title)s.%(ext)s" --playlist-reverse https://www.youtube.com/playlist?list=PLE7j5FieXSTc-2gbs7NkrDPhkS_rQS9XT |
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
$(document).ready(function() { | |
if(window.self !== window.top) { | |
var padding = 200; | |
var currentHeight = window.ApplicationHelpers.pageHeight() + padding; | |
var resizeIframeTracker = setInterval(function() { | |
$(document).ready(function() { | |
var height = window.ApplicationHelpers.pageHeight() + padding; | |
if(currentHeight !== height) { | |
message = JSON.stringify({"frameHeight": height}); | |
window.parent.postMessage(message, "*"); |
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
$(document).ready(function() { | |
if(window.self !== window.top) { | |
var currentHeight = document.body.clientHeight; | |
var resizeIframeTracker = setInterval(function() { | |
var height = document.body.clientHeight; | |
if(currentHeight !== height) { | |
message = JSON.stringify({"frameHeight": height}) | |
window.parent.postMessage(message, "*"); | |
currentHeight = height; | |
} |
NewerOlder