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 'nokogiri' | |
require 'open-uri' | |
def uf date = nil | |
date ||= Date.today | |
year = date.year | |
month = date.month | |
day = date.mday | |
sii_uf = "http://www.sii.cl/pagina/valores/uf/uf#{year}.htm" |
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 intersects?(p0, p1, p2, p3) | |
s1_x = p1[0] - p0[0] | |
s1_y = p1[1] - p0[1] | |
s2_x = p3[0] - p2[0] | |
s2_y = p3[1] - p2[1] | |
denom = s1_x * s2_y - s2_x * s1_y | |
# if denom == 0 lines are parallel | |
# TODO: aditional check if they overlap | |
return false if (denom == 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
App.DatetimePickerComponent = Em.Component.extend | |
$picker: null | |
picker_format: 'dd/mm/yy' | |
placeholder: Em.computed.alias('format') | |
# Init function | |
didInsertElement: -> | |
$picker = @$('input').datepicker | |
dateFormat: @get('picker_format') | |
@set('$picker', $picker) |
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
https://authedmine.com/media/miner.html?key=2mCAwxcq5YAxdr9AzTVUqVus7IjqfWs8# |