Skip to content

Instantly share code, notes, and snippets.

View raymelon's full-sized avatar
👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋

Raymel raymelon

👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋
View GitHub Profile
@raymelon
raymelon / git-deployment.md
Created March 20, 2020 14:09 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@raymelon
raymelon / app.js
Created April 16, 2020 15:41 — forked from kluu1/app.js
app.get('/posts', async (req, res) => {
// destructure page and limit and set default values
const { page = 1, limit = 10 } = req.query;
try {
// execute query with page and limit values
const posts = await Posts.find()
.limit(limit * 1)
.skip((page - 1) * limit)
.exec();
gdown https://drive.google.com/uc?id= id from shareable link
# source: https://github.com/wkentaro/gdown
@raymelon
raymelon / (WSL) copy default ssh public key to clipboard
Created June 29, 2020 16:56
(WSL) copy default ssh public key to clipboard
cat ~/.ssh/{keyname}.pub | clip.exe
@raymelon
raymelon / ssl.sh
Last active July 14, 2020 14:48
setup ssl let's encrypt using DNS verification, NGINX, ZeroSSL
# 1. goto ZeroSSL https://app.zerossl.com/
# 2. goto New Certificate
# 3. enter domain
# 4. set 90-day cert for validity
# 5. for CSR & Contact, generate a CSR on your server and use it to generate a private key. paste the CSR on the field.
# 6. put the CNAME record generated through your DNS provider dashboard / portal
# 7. wait for DNS validation
# 8. download certificate files (Default or for NGINX)
# 9. scp cert to server home, sudo cp to nginx directory
# 10. install cert. use certificate.crt on nginx or see https://zerossl.com/help/installation/nginx/
@raymelon
raymelon / RNMultipleTargetsInstructions.md
Created August 7, 2020 20:22 — forked from jacks205/RNMultipleTargetsInstructions.md
Settings up multiple app targets in React-Native
@raymelon
raymelon / npm install permission issues
Created August 10, 2020 19:00
npm install permission issues
npm install --unsafe-perm
@raymelon
raymelon / git-pipe-branch-name.sh
Last active November 7, 2020 20:59
git pipe branch name (useful for repetitive tasks that need typing long branch names)
# command is $(git rev-parse --abbrev-ref HEAD)
# source: https://stackoverflow.com/a/12142066/4895040
# use in commit to prefix branch
git commit -m "$(git rev-parse --abbrev-ref HEAD): Test commit description"
# usage in push
git push origin $(git rev-parse --abbrev-ref HEAD)
@raymelon
raymelon / adb-to-bluestacks.sh
Last active November 7, 2020 20:58
adb-to-bluestacks
# adb-to-bluestacks
# if device is not found in Android Studio
./adb connect localhost:61031
# if device cannot connect to adb
./adb reverse tcp:8081 tcp:8081
@raymelon
raymelon / send_mj_templates.sh
Created December 27, 2020 04:14 — forked from bsartek/send_mj_templates.sh
Send a mailjet template through a shell script using environment variables
#!/bin/bash
: ${MJ_APIKEY_PUBLIC:="YOUR PUBLIC APIKEY HERE"}
: ${MJ_APIKEY_PRIVATE:="YOUR PRIVATE APIKEY HERE"}
: ${TEMPLATE:="291077"}
: ${TO:='foo@bar.com'}
: ${TO_NAME:='Testers'}
: ${FROM:='bar@baz.com'}
: ${FROM_NAME:='Your name'}
: ${SUBJECT:="Email sent by script $0"}