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
| /** | |
| * capitalize.js | |
| * | |
| * @param {string} str | |
| * @returns string | |
| */ | |
| function capitalize(str) { | |
| } | |
| module.exports = { capitalize }; |
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
| /** | |
| * get.js | |
| * | |
| * @param {string | string[]} path | |
| * @param {object} data | |
| * @returns unknown | |
| */ | |
| function get(path, data) { | |
| } |
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
| // Exemplo de padrão modular usando IIFE | |
| var contador = (function () { | |
| var num = 0; | |
| return { | |
| incrementar: function () { | |
| return ++num; | |
| }, | |
| resetar: function () { |
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
| #!/bin/bash | |
| # csv2bib.sh | |
| # | |
| # SpringerLink CSV to BIB | |
| # | |
| # Author: Djalma Jr. | |
| # Site: djalmajr.com | |
| # | |
| # v0.3.0: Updated download link | |
| # v0.2.0: Added command line options |
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
| <!DOCTYPE html> | |
| <html lang="pt-br"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>App Loader</title> | |
| <style media="screen"> | |
| html, | |
| body { | |
| background-color: #F2F2F4; | |
| } |
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
| var Router = { | |
| routes: [], | |
| mode: null, | |
| root: '/', | |
| config: function(options) { | |
| this.mode = options && options.mode && options.mode == 'history' | |
| && !!(history.pushState) ? 'history' : 'hash'; | |
| this.root = options && options.root ? '/' + this.clearSlashes(options.root) + '/' : '/'; | |
| return this; | |
| }, |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
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
| (() => { | |
| window.createElement = (name, attrs = {}) => { | |
| const element = document.createElement(name); | |
| Object.keys(attrs).forEach(key => (element[key] = attrs[key])); | |
| return element; | |
| }; | |
| window.loadStyle = href => { | |
| return new Promise((onload, onerror) => { | |
| const style = createElement("link", { onload, onerror, href, rel: "stylesheet" }); |
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
| (function(console) { | |
| console.save = function(data, filename) { | |
| if (!data) { | |
| console.error("Console.save: No data"); | |
| return; | |
| } | |
| if (!filename) filename = "console.json"; | |
| if (typeof data === "object") { |
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
| import { html, render } from "https://unpkg.com/lit-html?module"; | |
| export * from "https://unpkg.com/lit-html?module"; | |
| export function createProperty(prototype, propertyName, options = {}) { | |
| if (!prototype.constructor.hasOwnProperty("properties")) { | |
| Object.defineProperty(prototype.constructor, "properties", { value: {} }); | |
| } | |
| prototype.constructor.properties[propertyName] = options; |