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
#!/usr/bin/env ruby | |
############################################################################### | |
# Pre-requirements | |
# | |
# - sudo apt update & sudo apt install imagemagick libmagick++-dev | |
# or | |
# - brew install imagemagick | |
# | |
# - gem install mini_magick prawn |
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
import { html, render } from 'https://cdn.skypack.dev/uhtml@3'; | |
import { effect, signal } from 'https://cdn.skypack.dev/usignal@0.9'; | |
const todos = signal([]); | |
const add = () => { | |
const uuid = crypto.randomUUID(); | |
const text = `Item ${uuid.split('-')[1]}`; | |
todos.value = todos.value.concat({ uuid, 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
const typeOf = (v) => ({}.toString.call(v).slice(8, -1).toLowerCase()); | |
const isObj = (v) => ["array", "object"].includes(typeOf(v)); | |
const isFn = (v) => "function" === typeOf(v); | |
function handler(callback) { | |
return { | |
get(obj, prop) { | |
if (prop === "_isProxy") return true; | |
let d = Object.getOwnPropertyDescriptor(obj, prop); | |
let ok = isObj(obj[prop]) && !obj[prop]._isProxy && d?.writable; |
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
const prefix = "δ"; | |
const isAttr = /([^\s\\>"'=]+)\s*=\s*(['"]?)$/; | |
const hasPfx = (str) => str.search(prefix) !== -1; | |
const create = (tag, cfg) => Object.assign(document.createElement(tag), cfg); | |
export function html(strings, ...values) { | |
const tmpl = values.reduce((r, _, i) => { | |
return `${r}${isAttr.test(r) ? prefix + i : `<!--${prefix + i}-->`}${strings[i + 1]}`; | |
}, strings[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
#!/bin/sh | |
set -e | |
PROGNAME=$(basename $0) | |
WORKING_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | |
OLD_TITLE="DTStart" | |
OLD_PACKAGE="old.package.name" | |
die() { | |
echo "$PROGNAME: $*" >&2 |
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
/** | |
* capitalize.js | |
* | |
* @param {string} str | |
* @returns string | |
*/ | |
function capitalize(str) { | |
} | |
module.exports = { capitalize }; |
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.js | |
* | |
* @param {string | string[]} path | |
* @param {object} data | |
* @returns unknown | |
*/ | |
function get(path, data) { | |
} |
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
// Exemplo de padrão modular usando IIFE | |
var contador = (function () { | |
var num = 0; | |
return { | |
incrementar: function () { | |
return ++num; | |
}, | |
resetar: function () { |
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 | |
# 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 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; | |
} |
NewerOlder