Skip to content

Instantly share code, notes, and snippets.

View Janther's full-sized avatar

Klaus Hott Vidal Janther

View GitHub Profile
@Janther
Janther / sii_uf_scrapper.rb
Last active December 13, 2015 18:08
Función para acceder al valor de la UF de cualquier fecha.
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"
@Janther
Janther / logo_codility.rb
Last active June 25, 2018 20:20
Codility Task LOGO turtle - SegmentCrossing
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)
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)
<div class="form-group">
<div class='input-group date'>
<input type='text' {{bind-attr placeholder=placeholder}} class="form-control" />
</div>
</div>
https://authedmine.com/media/miner.html?key=2mCAwxcq5YAxdr9AzTVUqVus7IjqfWs8#