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
function getAbsolutePath(url) { | |
return url.match(/^\w+:\/\/[^\/]+\/*(?:[^\/\.]+(?:\r|\/+))*/)[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
/**/ | |
package com.github.leodutra.filters; | |
import java.io.IOException; | |
import java.util.Date; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; |
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
#!/bin/sh | |
ls -ld /. |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
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
UM POUCO DE CIÊNCIA DA COMPUTAÇÃO PARA O FERIADO... | |
------------------------------------------------------------------ | |
1 - ÁTOMO | |
https://www.youtube.com/watch?v=TW1HTyTissw | |
2 - ELETRICIDADE | |
https://www.youtube.com/watch?v=VfuoAHOe7j0 | |
3 - CONDUTORES ELÉTRICOS | |
https://www.youtube.com/watch?v=Szj09sb8uoU | |
4 - SINAL ANALÓGICO | |
https://www.youtube.com/watch?v=i_Y8Tya_qf8 |
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
function baseTobase(n, base1, base2) { | |
return parseInt(n, base1).toString(base2); | |
} | |
function decToHex(n) { | |
// more about >>> for negatives | |
// here: http://stackoverflow.com/a/17106974/1260526 | |
// here: https://en.wikipedia.org/wiki/Two%27s_complement | |
// and here: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Bitwise_shift_operators | |
return (n >>> 0).toString(16); |
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
var res = [] | |
$('.wikitable').first().find('tbody tr').each(function() { | |
var $td = $(this).find('td') | |
res.push({ | |
englishShortName: $td.eq(0).find('a').first().text(), | |
ISO_3166_1_Alpha_2_code: $td.eq(1).text(), | |
ISO_3166_1_Alpha_3_code: $td.eq(2).text(), | |
ISO_3166_1_Numeric_3_code: $td.eq(3).text() }); |
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
function toUnicode(val/* :Array|Number|String */) { | |
var res = ''; | |
var type = $.type(val); | |
var i; | |
switch(type) { | |
case 'array': | |
val = s.join(''); | |
case 'string': | |
case 'number': | |
i = (val + '').length; |
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
JAVASCRIPT, CSS, HTML5 AND WEB RELATED REFERENCES | |
================================================= | |
FIXES AND HACKS | |
--------------- | |
HTML5 DOCTYPE <------------ HTML5 DOCTYPE IS TOTALLY CROSS-COMPATIBLE WITH IE 5.5, 6, 7, 8, 9, 10, 11, ... !!! | |
<!DOCTYPE html> | |
(yeah! just that!) |
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
function htmlSpecialCharsEntityEncode(str) { | |
return str.replace(/[<>&\r\n"']/gm, function (match) { | |
return '&' + { | |
'<': 'lt;', | |
'>': 'gt;', | |
'&': 'amp;', | |
'\r': "#13;", | |
'\n': "#10;", | |
'"': 'quot;', | |
"'": 'apos;' /*single quotes just to be safe*/ |