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
let countries = [ | |
Country(name: "United States", emoji: "🇺🇸"), | |
Country(name: "United Kingdom", emoji: "🇬🇧"), | |
Country(name: "Afghanistan", emoji: "🇦🇫"), | |
Country(name: "Albania", emoji: "🇦🇱"), | |
Country(name: "Algeria", emoji: "🇩🇿"), | |
Country(name: "Andorra", emoji: "🇦🇩"), | |
Country(name: "Angola", emoji: "🇦🇴"), | |
Country(name: "Antigua & Barbuda", emoji: "🇦🇬"), | |
Country(name: "Argentina", emoji: "🇦🇷"), |
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 express = require("express") | |
const app = express(); | |
const puerto = 8893; | |
const environment = process.env.NODE_ENV | |
const Cors = require("cors") | |
const fileupload = require('express-fileupload') | |
const jwt = require('jsonwebtoken'); | |
// Middlewares | |
app.use(Cors()); |
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
function validateDataFields(params, paramsToMatch, origin) { | |
let i = 0; | |
let receivedData = Object.keys(params); | |
let missingFields = new Array(); | |
let error = { | |
error: 0, | |
isError: false, | |
message: "", | |
error: null, | |
}; |
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
// Modules | |
const MichaelBot = require("./botLogic.js") | |
[. . . ] | |
// ++++++++++++++++ HTTP METHODS +++++++++++++++++++ // | |
[. . . ] | |
app.post("/send_message", async (req, res) => { |
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 TelegramBot = require('node-telegram-bot-api'); | |
function sendMessage(message, botId, chatId) { | |
const bot = new TelegramBot(botId, { polling: false }); | |
try { | |
bot.sendMessage(chatId, message) | |
} catch { | |
return 'Something went wrong when trying to send a Telegram notification' | |
} |
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 express = require("express") | |
const app = express(); | |
const puerto = 9001; | |
const Cors = require("cors") | |
// Middlewares | |
app.use(Cors()); | |
app.use(express.json()); | |
app.use(express.urlencoded({ extended: false })) |
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
# Change theme to "awesomepanda" | |
apt-get install zsh | |
apt-get install git-core | |
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh | |
chsh -s `which zsh` | |
source .zshrc |
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
struct ControllerWrapper: UIViewControllerRepresentable { | |
typealias UIViewControllerType = <Your_Controller> | |
func makeUIViewController(context: UIViewControllerRepresentableContext<ControllerWrapper>) -> | |
ControllerWrapper.UIViewControllerType { | |
return <Your_Controller>() | |
} | |
func updateUIViewController(_ uiViewController: ControllerWrapper.UIViewControllerType, |
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
cd $1 && | |
npm uninstall --save typescript @types/jest @typescript-eslint/eslint-plugin @typescript-eslint/parser @vue/cli-plugin-typescript @vue/eslint-config-typescript && | |
git add . && git commit -m "removed typescript modules" && | |
rm tsconfig.json && | |
mv src/main.ts src/main.js && | |
rm src/shims-vue.d.ts && | |
mv src/router/index.ts src/router/index.js && | |
sed -i '' "s/: Array<RouteRecordRaw>//g" src/router/index.js && | |
sed -i '' "s/import { RouteRecordRaw } from 'vue-router';//g" src/router/index.jsm && | |
sed -i '' "s/<script lang=\"ts\">/<script>/g" src/App.vue && |
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
// ************************************************************************************************* // | |
// | |
// In order to upload a Smart contract we have to follow a series of steps: | |
// | |
// 1. Library imports | |
// a) solc: .sol file's extension compiler | |
// b) fs: Node native file reader | |
// c) web3: A new web3 instance that connects to Ganache's default port | |
// | |
// 2. Smart Contract compilation |
NewerOlder