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
/** | |
* Minecraft Disks | |
*/ | |
body{ | |
background: black url(http://minecraftstal.com/stal.png) 0/30px; | |
animation: disks 2s linear 0 infinite; | |
min-height: 100%; | |
overflow: hidden; | |
} |
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
@echo off | |
rem => Minecraft Protocol Handler | |
rem Enable minecraft:\\ protocol in Windows | |
rem Usage: minecraft:\\hostname.tld:port | |
color 1f | |
set input=%1 | |
if a%input%z == az set input=null |
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
# MCEdit Filter by CrushedPixel | |
# http://youtube.com/CrushedPixel | |
# source: http://www.mediafire.com/view/o6af3cuo45pj9pn/CPTerraformingClay.py | |
displayName = "Natural Blocks to Clay" | |
inputs = () | |
blocks = [ | |
['35:0', 80], # white stained clay |
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
class Game | |
(awesome) -> | |
@party = -> -> | |
if awesome | |
'Party!' | |
minecraft = new Game(yes) | |
minecraft.party()! |
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
// REPL - Ler, compilar, mostrar, repetir | |
!function repl ( // colocar ! atrás da função: economiza um caractere, ao invés de usar () | |
input // para não ter que colocar "var " colocamos nos argumentos | |
) { | |
input = prompt('Insira um comando:'); // "prompt" lê a entrada | |
if (input) // se o usuário entrou com um comando, então: | |
alert(eval(input)), // alerta o resultado do comando, usando "eval" | |
setTimeout(repl) // chama a função novamente depois de 4ms | |
}() // executa a função, iniciando o loop |
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
window.onscroll = function onScroll() { | |
var htmlEl = document.documentElement, | |
alturaJanela = htmlEl.clientHeight, | |
alturaTotal = Math.max(document.body.scrollHeight, htmlEl.scrollHeight, document.body.offsetHeight, htmlEl.offsetHeight, htmlEl.clientHeight); | |
// Aplique a lógica que quiser, usei: se o scroll | |
if(alturaTotal - 2 * alturaJanela < window.scrollY) { | |
carregarDados(); | |
} | |
window.onscroll = null; |
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
/** Get the maximum call stack and the error it generates */ | |
(function () { | |
var results = {}; | |
(function f (a) { | |
try { | |
f(a+1); | |
} catch (e) { | |
results[a] = e; | |
} | |
}(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
// Example usage: | |
var example1 = {foo: {bar: 1}}, | |
example2 = {foo: {bar: 1, qux: 1}}, | |
example3 = {foo: {BAZ: 1}}, | |
template1 = {foo: {bar: 1}} | |
template2 = {foo: {bar: {qux: 1}}}}, | |
// returns true: all keys from the template exist in the object | |
hasChainOfKeys(example1, template1); |
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
/** | |
* Validates e-mail addresses | |
* Supports internacionalized e-mails | |
*/ | |
function isValidEmail(input) { | |
// Split the e-mail into local part and domain part: | |
var parts = input.split('@'); | |
// It needs to have those two parts: | |
if (parts.length !== 2) return false; |
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 reservedWords = "arguments caller length name prototype __proto__".split(" ") | |
module.exports = createNamedParameters | |
function createNamedParameters(argv, fn) { | |
var length = fn.length | |
var composed = Array(length) | |
if (argv.length !== length) throw new Error("Argument lengths don't match") | |
function composing() { |
OlderNewer