Skip to content

Instantly share code, notes, and snippets.

View vitoravale's full-sized avatar
🏠
Working from home

Vitor A. Vale vitoravale

🏠
Working from home
View GitHub Profile
@vitoravale
vitoravale / amplify-create-subdomain.js
Created October 18, 2023 21:10 — forked from dtelaroli/amplify-create-subdomain.js
Creates an amplify subdomain with aws javascript sdk
const { to } = require("await-to-js");
const { Amplify } = require("aws-sdk");
const amplify = new Amplify();
const config = {
AMPLIFY_FRONTEND_APP_ID: "your_app_id",
AMPLIFY_FRONTEND_DOMAIN: "your_domain.com",
AMPLIFY_FRONTEND_BRANCH: "your_branch_env"
};
const { app, BrowserWindow, shell, Tray, ipcMain, Menu, TouchBar , nativeImage } = require('electron');
const { TouchBarButton, TouchBarLabel, TouchBarSpacer } = TouchBar;
const { platform } = require('os')
const path = require('path');
const isDev = require('electron-is-dev');
const electron = require('electron')
let mainWindow,tray;
const winURL = isDev
? 'http://localhost:8080'
: `file://${path.join(__dirname, '../build/index.html')}`
@vitoravale
vitoravale / purgeAndroid.txt
Created February 15, 2018 00:24 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@vitoravale
vitoravale / app.js
Created February 2, 2018 00:26
hearthstone json to tsv
const https = require('https')
const fs = require('fs')
const url = 'https://api.hearthstonejson.com/v1/22611/enUS/cards.collectible.json';
https.get(url, res => {
res.setEncoding('utf-8');
let body = '';
res.on('data', data => {
body += data;
})
@vitoravale
vitoravale / app.js
Last active January 25, 2018 13:56
QnA Maker Bot With Active Learning
const builder = require('botbuilder')
const restify = require('restify')
const cognitiveServices = require('botbuilder-cognitiveservices') // incluir no projeto npm i -s botbuilder-cognitiveservices
//=========================================================
// Bot Setup
//=========================================================
const port = process.env.port || process.env.PORT || 3978
const server = restify.createServer()
@vitoravale
vitoravale / gist:a9283b87e572c25b604ac00986702fa1
Created October 13, 2017 11:43
Accent Folding in Javascript
var accent_map = {
'ẚ':'a','Á':'a','á':'a','À':'a','à':'a','Ă':'a','ă':'a','Ắ':'a','ắ':'a','Ằ':'a','ằ':'a','Ẵ':'a','ẵ':'a','Ẳ':'a','ẳ':'a','Â':'a','â':'a','Ấ':'a','ấ':'a','Ầ':'a','ầ':'a','Ẫ':'a','ẫ':'a','Ẩ':'a','ẩ':'a','Ǎ':'a','ǎ':'a','Å':'a','å':'a','Ǻ':'a','ǻ':'a','Ä':'a','ä':'a','Ǟ':'a','ǟ':'a','Ã':'a','ã':'a','Ȧ':'a','ȧ':'a','Ǡ':'a','ǡ':'a','Ą':'a','ą':'a','Ā':'a','ā':'a','Ả':'a','ả':'a','Ȁ':'a','ȁ':'a','Ȃ':'a','ȃ':'a','Ạ':'a','ạ':'a','Ặ':'a','ặ':'a','Ậ':'a','ậ':'a','Ḁ':'a','ḁ':'a','Ⱥ':'a','ⱥ':'a','Ǽ':'a','ǽ':'a','Ǣ':'a','ǣ':'a',
'Ḃ':'b','ḃ':'b','Ḅ':'b','ḅ':'b','Ḇ':'b','ḇ':'b','Ƀ':'b','ƀ':'b','ᵬ':'b','Ɓ':'b','ɓ':'b','Ƃ':'b','ƃ':'b',
'Ć':'c','ć':'c','Ĉ':'c','ĉ':'c','Č':'c','č':'c','Ċ':'c','ċ':'c','Ç':'c','ç':'c','Ḉ':'c','ḉ':'c','Ȼ':'c','ȼ':'c','Ƈ':'c','ƈ':'c','ɕ':'c',
'Ď':'d','ď':'d','Ḋ':'d','ḋ':'d','Ḑ':'d','ḑ':'d','Ḍ':'d','ḍ':'d','Ḓ':'d','ḓ':'d','Ḏ':'d','ḏ':'d','Đ':'d','đ':'d','ᵭ':'d','Ɖ':'d','ɖ':'d','Ɗ':'d','ɗ':'d','Ƌ':'d','ƌ':'d','ȡ':'d','ð':'d',
'É':'e','Ə':'e','Ǝ':'e','ǝ':'e','é':'e','È':'e','è':
@vitoravale
vitoravale / .eslintrc.json
Created July 12, 2017 13:39 — forked from leny/.eslintrc.json
ESLint config file for node.js + ES6 projects.
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,