- Github: https://github.com
- Gitlab: https://about.gitlab.com/
- Bitbucket: https://bitbucket.org/
- Twitter Bootstrap: http://getbootstrap.com/
- Foundation Zurb: http://foundation.zurb.com/
| class Array | |
| <<-DOC | |
| 8, 3, -2, -7, -12, ... | |
| 3 - 8 = -5 | |
| -2 - 3 = -5 | |
| -7 - (-2) = -5 | |
| -12 - (-7) = -5 | |
| d = −5. |
| def date_diff(date1, date2) | |
| month = (date2.year * 12 + date2.month) - (date1.year * 12 + date1.month) | |
| month.divmod(12) | |
| end | |
| #for get the years | |
| date_diff(date, Date.today)[0] | |
| #for get the months | |
| date_diff(date, Date.today)[1] |
| var holidays =[] | |
| //holiday model ruby, table that save all the holidays federal | |
| holidays = "<%= Holiday.all.map{ |h| h.date.strftime("%Y-%m-%d") } %>"; | |
| /*example "2015-10-12", "2015-11-02", "2015-11-16", "2015-12-08", "2015-12-25", "2016-01-01", | |
| "2016-01-11", "2016-03-21", "2016-03-24", "2016-03-25", "2016-05-01", "2016-05-09", "2016-05-30", | |
| "2016-06-06", "2016-07-04", "2016-07-20", "2016-08-07", "2016-08-15", "2016-10-17", "2016-11-07", | |
| "2016-11-14", "2016-12-08", "2016-12-25"]*/ | |
| $('.date').datepicker({ |
| module Jekyll | |
| class Terminal < Liquid::Block | |
| def initialize(tag_name, text, tokens) | |
| super | |
| @text = text | |
| end | |
| def render(context) | |
| text = super.gsub("\n", "<br/>") |
| $(function() { | |
| // Better performance in replacing js in any browsers. http://jsperf.com/encode-html-entities | |
| if($.browser.name != "chrome") { | |
| var tagsToReplace = { | |
| '&': '&', | |
| '<': '<', | |
| '>': '>', | |
| ' ': ' ', | |
| '#': '<root>[root@localhost]# </root>', | |
| '$': '<user>[user@localhost]$ </user>' |
| (function ($) { | |
| $.fn.sortable = function (options){ | |
| options = $.extend({ | |
| url: null | |
| }, options); | |
| return this.each(function (){ | |
| var handle = $(this); | |
| var items = handle.children(options.items); |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| class User | |
| STATUS = {active: "Active", inactive: "Inactive", invited:"Invited"} | |
| STATUS.each_with_index do |(meth, value)| | |
| define_method("is_#{meth}?"){status == value} | |
| end | |
| def initialize(name, email, password, status) | |
| @name = name |
| echo '<!DOCTYPE html> | |
| <html lang="es"> | |
| <head> | |
| <style type="text/css"> | |
| body{font-size: 12px; font-family: monospaced} | |
| ul, li{list-style-type: none} | |
| textarea{ | |
| width: 300px; | |
| height: 300px; | |
| } |