Skip to content

Instantly share code, notes, and snippets.

View danieltorscho's full-sized avatar
🏠
Online

Daniel Torscho danieltorscho

🏠
Online
View GitHub Profile
myArray = await Promise.all(
myArray.map(async item => {
return await axios.get('https://url)
})
)
@danieltorscho
danieltorscho / ubuntu-20-04-nodejs-initial-setup.md
Last active January 18, 2024 17:18
Ubuntu initial setup for Node.js

Initial Server Setup with Ubuntu 20.04

project: kizlyarsk username: amroll

(Optional) Enable SSH access for non root-users

  1. sudo vi /etc/ssh/sshd_config
  2. change PasswordAuthentication from no to yes
  3. save and exit
  4. restart ssh sudo systemctl restart ssh
@danieltorscho
danieltorscho / on-merge-deploy-to-do.md
Last active June 21, 2024 10:04
GitHub Actions deploy nodejs to DigitalOcean Droplet

Github deployment

Requirements:

  • DigitalOcean Droplet (Ubuntu 20.04+) should be created
  • Github repository

Prepare DO Droplet Server:

  • ssh root@DROPLET_IP
  • sudo vi /etc/ssh/sshd_config
  • change PasswordAuthentication from no to yes
Organisation ID Organisation Name Postcode Industry
111 Organisation A SW2 4DL School
123 Organisation B S2 5PS School
234 Organisation C EC2 3AD School
@danieltorscho
danieltorscho / multi-account-ssh.md
Created April 22, 2021 14:43
Multiple SSH Keys settings for different github account

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@danieltorscho
danieltorscho / gist:760076638eb1cd7c7c932624b826f425
Created September 23, 2020 10:07
[2020-02-28] Server configuration for Laravel 7:
[2020-02-28] Server configuration for Laravel 7:
================================
## Open SSH for non root-users
- `sudo vi /etc/ssh/sshd_config`
- change `PasswordAuthentication` from `no` to `yes`
- save and exit
- restart ssh `sudo systemctl restart ssh`
## Create super-user
@danieltorscho
danieltorscho / checkModuleExists.js
Created August 7, 2019 09:39
Check module existence within Front end
/**
* Check if required module exists physically
*
* Checking if a requested filename is existing physically
* without having to load it before for performance purpose.
* This check should be made before requiring the script.
*
* @param {*} filename Name of the file to check for
*/
moduleExists (filename) {
@danieltorscho
danieltorscho / composer.json
Created January 31, 2019 22:57
Dynamically create a database.sqlite within composer project
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"php -r \"file_exists('database/database.sqlite') || fopen('database/database.sqlite', 'w');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
@danieltorscho
danieltorscho / package.json
Created September 6, 2017 17:34
Webpack Browsersync Laravel 5.4
{
"scripts": {
"tdd": "cross-env NODE_ENV=testing node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"cross-env": "^3.2.3",
"laravel-mix": "0.*"
},
"dependencies": {
}
@danieltorscho
danieltorscho / queries.less
Last active November 23, 2015 00:06
Media queries uses alongside with Twitter Bootstrap 3
// Media Queries Mixins
@xs: ~'max-width: @{screen-xs-max}';
// @media(@xs){}
@smmin: ~'min-width: @{screen-sm-min}';
// @media(@smmin) and (@smmax){}
@smmax: ~'max-width: @{screen-sm-max}';
// @media(@smmin){}
@mdmin: ~'min-width: @{screen-md-min}';
// @media(@mdmin) and (@mdmax){}