Skip to content

Instantly share code, notes, and snippets.

View jamilservicos's full-sized avatar
👽
between lines and thoughts

Gervasio Junior jamilservicos

👽
between lines and thoughts
View GitHub Profile
@jamilservicos
jamilservicos / sb-struct-hello-world.json
Last active February 6, 2024 13:56
sb-struct-hello-world.json
{"element":"section","dataset":{"state":"hello-world.view","example":"hello-word"},"shadow":{"mode":"closed","styles":"\"html { width: 100%; max-width: 100%; height: 100%; max-height: 100%; box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background-color: #fff; overflow: hidden;}*,*::before,*::after { width: fit-content; height: fit-content; min-width: auto; min-height: auto; max-width: inherit; max-height: inherit; box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: transparent;}body { background-color: inherit; color: #000; width: 100%; height: 100%; overflow: auto;}h1, h2, h3, h4, h5, h6 { font-weight: 500;}strong,b { font-weight: bold; line-height: inherit;}em,i { font-style: italic; line-height: inherit;}ul, ol { list-style: disc inside;}ul[role=list],ol[role=list] { list-style: none;}a {
@jamilservicos
jamilservicos / .qovery.yml
Last active June 11, 2021 07:48
a simple example of nodejs on qovery
application:
name: test-nodejs-qovery
project: nodejs-qovery
publicly_accessible: true
routers:
- name: main
routes:
- application_name: test-nodejs-qovery
paths:
- /
@jamilservicos
jamilservicos / signature.js
Created December 14, 2020 12:12 — forked from leecade/signature.js
simple signature with node-crypto api
const crypto = require('crypto')
const sign = (value, secret) => {
return value + '.' + crypto
.createHmac('sha256', secret + '')
.update(value + '')
.digest('base64')
.replace(/\=+$/, '')
}
@jamilservicos
jamilservicos / README.md
Created October 10, 2020 04:37 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jamilservicos
jamilservicos / capitaLize.js
Last active October 6, 2020 15:53
simple example of uppercase, lowercase and capitalize text
/*
simple example to capitalize
*/
function capitaLize() {
const textbox = document.getElementById("text-box"); //textarea
const textresult = document.getElementById("text-result"); //result element "<pre>";
if ((textbox) && (textbox.value) && (textbox.value.toString().trim().length > 0)) {
textresult.innerText = "";
const str = textbox.value.toString().trim().toLowerCase(); //turns everything to lowercase
@jamilservicos
jamilservicos / apache-escape.js
Created October 2, 2020 03:56
simple example of HTML escape with and without break line. With list of chars based on the Apache Foundation's module
/*
based on the Apache Foundation module
https://github.com/apache/commons-lang/blob/7bbbdd2477305992e4d809db5288d6f62718124b/src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
*/
const apache = {
"\u00A0": "&nbsp;",
"\u00A1": "&iexcl;",
"\u00A2": "&cent;",
"\u00A3": "&pound;",
"\u00A4": "&curren;",
@jamilservicos
jamilservicos / languagechoose.js
Last active October 1, 2020 07:23
simple example of language choose
/*
css example
.hide {
display: none !important;
}
//==
simple HTML example
<div class="language">
<span data-lang="pt-br">PT-BR</span>
<span data-lang="en">EN</span>
@jamilservicos
jamilservicos / convertToMiota.php
Created April 18, 2018 10:27
Convert Brazilian Real (BRL) to MIOTA
<?php
/**
* Name: BRL to MIOTA
* Description: Convert Brazilian Real (BRL) to MIOTA
* Author: Jamil Serviços
* Author URI: https://fb.com/JamilServicos/
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*
@jamilservicos
jamilservicos / arrayupdate.js
Created March 11, 2017 11:29
update array from other array
const data = {};
data.final = [
{ "id": 0, "name": "Fleming James" },
{ "id": 1, "name": "Everett Johnson" },
{ "id": 2, "name": "Brock Owens" }
];
data.update = [
{ "id": 0, "name": "Catherine Cooley" },
{ "id": 1, "name": "Mavis Grant" },
const doc = [
{"status":"1","name":"Item5","order":0,"submenuId":"0","subid":1},
{"status":"1","name":"Item1","order":2,"submenuId":"0","subid":5},
{"status":"1","name":"Item2","order":1,"submenuId":"0","subid":2}
];
/* Ascending: (order field)
output sort:
{"status":"1","name":"Item5","order":0,"submenuId":"0","subid":1},
{"status":"1","name":"Item2","order":1,"submenuId":"0","subid":2},