Skip to content

Instantly share code, notes, and snippets.

View jdgabriel's full-sized avatar
👋
console.log("Hello World")

Gabriel Duarte jdgabriel

👋
console.log("Hello World")
View GitHub Profile
@jdgabriel
jdgabriel / app.component.htm
Created June 19, 2021 15:48
Select All, Unselect All - Nebular
<nb-select multiple placeholder="Select Showcase"
[(selected)]="selectedItem"
(selectedChange)="selecionar($event)">
<nb-select-label>
Selected: {{ selectedItem }}
</nb-select-label>
<nb-option value="todos" *ngIf="todoss">Selecionar todos</nb-option>
<nb-option value="disabled" *ngIf="!todoss">Limpar seleção</nb-option>
<nb-option value="0">Option 0</nb-option>
@jdgabriel
jdgabriel / crypto-aes-256-gcm-demo.js
Created June 23, 2020 20:17 — forked from rjz/crypto-aes-256-gcm-demo.js
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// Hint: the `iv` should be unique (but not necessarily random).
@jdgabriel
jdgabriel / choco_install.txt
Last active October 12, 2019 00:11
Chocolatey Install - First Install
choco install vscode git nodejs yarn hyper winrar -y
@jdgabriel
jdgabriel / .hyper.js
Last active September 11, 2019 01:29
Example configuration Hyper Terminal with GIT Bash
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@jdgabriel
jdgabriel / date-fns.js
Created September 3, 2019 14:23
date-fns - Date Format Brazil
const { parseFromTimeZone, formatToTimeZone } = require('date-fns-timezone')
const { getTime, toDate } = require('date-fns')
const dataTime = getTime(new Date()) // 1567520182997
const dataDate = toDate(dataTime)
const date = new Date()
const format = 'DD.MM.YYYY HH:mm:ss.SSS [GMT]Z'
const output = formatToTimeZone(dataTime, format, { timeZone: 'America/Sao_Paulo' })
@jdgabriel
jdgabriel / twitch_url.php
Created August 2, 2019 14:35
Construct Twitch URL - Get Stream
<?php
// URL da Request
$url_base = "https://api.twitch.tv/helix/streams?user_login=";
// Something is wrong String
$qs = "jukes";
// Array de Streamers
$stream = array("jukes","gaules","lineage2Oficial");
@jdgabriel
jdgabriel / .htaccess
Created July 25, 2019 14:52
.htaccess
Options +MultiViews
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1\.php [R=301,L]