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
collections_config: | |
pages: | |
_enabled_editors: | |
- visual | |
posts: | |
_enabled_editors: | |
- content | |
- visual | |
_inputs: |
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 'json' | |
input = "[[0,5,6,11,15],[12,24,63],[17,28,50]]" | |
input = JSON.parse(input) | |
start = Time.now | |
min_column = input.map{|a| a[0]} | |
max = min_column.max | |
second_smallest = min_column.sort[1] |
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
--- | |
layout: null | |
--- | |
[ | |
{% for doc in site.docs %} | |
{ | |
"title": "{{ doc.title | xml_escape }}", | |
"description": "{{doc.description | xml_escape }}", | |
"type": "{{doc.type | xml_escape}}" |
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
User.joins("LEFT OUTER JOIN friendships ON \ | |
(friendships.user_id = #{current_user.id} AND friendships.friend_id = users.id) OR \ | |
(friendships.user_id = users.id AND friendships.friend_id = #{current_user.id})") | |
.where("friendships.id IS NULL") |
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
Time.strptime("2011-05-21 04:20:46.011", "%Y-%m-%d %H:%M:%S.%3N") |
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
def self.date_intersect(start_date, end_date) | |
where("(start_time BETWEEN ? AND ?) OR \ | |
(end_time BETWEEN ? AND ?) OR \ | |
(start_time >= ? AND end_time <= ?)", start_date, end_date, start_date, end_date, start_date, end_date) | |
end |