This file contains hidden or 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 Time | |
| def to_date | |
| Date.parse(self.to_s) | |
| end | |
| end |
This file contains hidden or 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('underscore') | |
| w = (str) -> str.split(' ') | |
| cities = | |
| "Arad": {name: "Arad", distance: 366, neighbors: w "Zerind Timisoara Sibiu"} | |
| "Bucharest": {name: "Bucharest", distance: 0, neighbors: w "Urziceni Giurgiu Pitesti Fagaras"} | |
| "Craiova": {name: "Craiova", distance: 160, neighbors: w "Drobeta Pitesti Rimnicu"} | |
| "Drobeta": {name: "Drobeta", distance: 242, neighbors: w "Mehadia Craiova"} | |
| "Eforie": {name: "Eforie", distance: 161, neighbors: w "Hirsova"} |
This file contains hidden or 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
| interpret = (code) -> | |
| commands = | |
| '+' : => | |
| @stack.push(@stack.pop() + @stack.pop()) | |
| '-' : => | |
| @stack.push(-@stack.pop() + @stack.pop()) | |
| '*' : => | |
| @stack.push(@stack.pop() * @stack.pop()) |
This file contains hidden or 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 Player | |
| attr_accessor :name, :points, :explosions | |
| def initialize(name) | |
| @name = name | |
| @points = 0 | |
| @explosions = 0 | |
| end | |
| def add_points(pts) |
This file contains hidden or 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
| fromNow = (d) -> | |
| unless d instanceof Date | |
| d = new Date(d) | |
| difference = d - new Date() | |
| # string, limit, divider | |
| limits = [ | |
| ["momentos", 1000, 1] | |
| ["%d segundos", 1000*60, 1000] |
This file contains hidden or 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
| mapize = (str, pairSeparator, keyValueSeparator, fnKey, fnValue) -> | |
| map = {} | |
| for pair in str.split(pairSeparator) | |
| [key, value...] = pair.split(keyValueSeparator) | |
| map[fnKey(key)] = fnValue(value.join('=')) | |
| return map | |
| urlParams = -> | |
| mapize(window.location.search.substring(1), '&', '=', decodeURIComponent, decodeURIComponent) |
This file contains hidden or 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
| for i in `find src -type f -name \*.html | xargs grep 'io.vtex.com.br[^"]*' -oh`; do echo $i; echo -ne ' -> '; curl -Is $i | head -1; done |
This file contains hidden or 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
| A+ 10 | |
| A 10 | |
| A- 9.6 | |
| B+ 8.8 | |
| B 8.4 | |
| B- 8 | |
| C+ 7.5 | |
| C 7 | |
| C- 6.5 | |
| D+ 6 |
This file contains hidden or 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
| INF1001 - INTR CIENCIA DA COMPUTACAO | |
| INF1002 - CALCULO NUMERICO | |
| INF1004 - PROGRAMACAO P/ INFORMATICA I | |
| INF1005 - PROGRAMACAO I | |
| INF1006 - PROGRAMACAO P/ INFORMATICA II | |
| INF1007 - PROGRAMACAO II | |
| INF1008 - INTROD ARQ DE COMPUTADORES | |
| INF1009 - LOGICA PARA COMPUTACAO | |
| INF1010 - ESTRUTURAS DE DADOS AVANCADAS | |
| INF1011 - SEMANTICA DE LINGUAGENS |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Requires LibreOffice | |
| # Use `find` if you need something more advanced | |
| files=`echo *.doc` | |
| for file in $files; do lowriter --convert-to pdf:writer_pdf_Export $file; done |
OlderNewer