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
/** | |
* js-timeout-polyfill | |
* @see https://blogs.oracle.com/nashorn/entry/setinterval_and_settimeout_javascript_functions | |
*/ | |
(function (global) { | |
'use strict'; | |
if (global.setTimeout || | |
global.clearTimeout || | |
global.setInterval || |
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
// form http://blueimp.github.com/JavaScript-MD5/ | |
var md5 = function (str) { | |
/* | |
* Add integers, wrapping at 2^32. This uses 16-bit operations internally | |
* to work around bugs in some JS interpreters. | |
*/ | |
function safe_add(x, y) { | |
var lsw = (x & 0xFFFF) + (y & 0xFFFF), | |
msw = (x >> 16) + (y >> 16) + (lsw >> 16); |
#Unix Toolbox
This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.
##Unix Toolbox revision 14.4
The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
Error reports and comments are m
É difícil falar de Ruby sem mencionar seu framework web mais famoso, Ruby on Rails. Mas não adianta muito encarar o framework sem um prévio estudo da linguagem (o que de fato já observei acontecer inúmeras vezes). Esse post tem como intuito auxiliar na aprendizagem tanto da linguagem como do framework, para evitar que erros comuns como esse tornem a utilização de ambos um desastre.
Ruby é uma linguagem de programação que apareceu para o mundo em 1995, criada por Yukihiro "Matz" Matsumoto. Tem como características o fato de ser uma linguagem de uso geral, com tipagem dinâmica e forte, orientada a objetos e que incorpora diversos paradigmas de programação, como o funcional e o imperativo.
- Ruby in Twenty Minutes - É o que o nome diz: um pequeno tutorial que promete não tomar mais do que 20 minutos do seu tempo. Se encarrega de mostrar como baixar e instalar o Ruby. Faz grande uso da IRB (Int
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
# Available only in the 2.2 legacy branch and posterior versions | |
func _ready(): | |
# The old way: | |
print("HELLO") # Code before the yield | |
# Setting up the yield: | |
var t = Timer.new() # Create a new Timer node | |
t.set_wait_time(5.5) # Set the wait time | |
add_child(t) # Add it to the node tree as the direct child |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 24, | |
// font family with optional fallbacks | |
fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: '#1df9ca', |
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/bash | |
# NOTE: actually it would be nice to add something like the branch and SHA, but for the sake of demonstration I'm just using this file to feed Wakatime | |
# these variables are not used, but they might be useful; for someone else to play around | |
MESSAGE=$1 | |
SHA=$(git rev-parse HEAD) | |
BRANCH=$(git symbolic-ref --short HEAD) | |
# give it a name |
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
NewerOlder