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 / moment-greetings.js
Created January 2, 2021 07:39 — forked from AllanPooley/moment-greetings.js
Time based user greetings (Good Morning, Afternoon, Evening) using moment.js
getGreetingTime = (currentTime) => {
if (!currentTime || !currentTime.isValid()) { return 'Hello'; }
const splitAfternoon = 12; // 24hr time to split the afternoon
const splitEvening = 17; // 24hr time to split the evening
const currentHour = parseFloat(currentTime.format('HH'));
if (currentHour >= splitAfternoon && currentHour <= splitEvening) {
// Between 12 PM and 5PM
return 'Good afternoon';
@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:='[email protected]'}
: ${TO_NAME:='Testers'}
: ${FROM:='[email protected]'}
: ${FROM_NAME:='Your name'}
: ${SUBJECT:="Email sent by script $0"}
@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 / 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();
@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.

add_action( 'wp_enqueue_scripts', 'my_custom_script_load' );
function my_custom_script_load(){
wp_enqueue_script( 'my-custom-script', get_stylesheet_directory_uri() . '/custom-scripts', array( 'jquery' ) );
}
@raymelon
raymelon / watchdog_example.py
Created June 21, 2019 05:51 — forked from njanakiev/watchdog_example.py
Simple example of monitoring file system events in Python with the watchdog module
import sys
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import time
class EventHandler(FileSystemEventHandler):
def on_any_event(self, event):
print("EVENT")
print(event.event_type)
print(event.src_path)
@raymelon
raymelon / gist:8f6a626049f144bd429b59701a054487
Created January 24, 2018 10:14 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@raymelon
raymelon / Makefile
Created January 22, 2018 17:21 — forked from bbengfort/Makefile
Basic Python Project files - my Makefile and the dependencies that I have in everything.
# Shell to use with Make
SHELL := /bin/bash
# Set important Paths
PROJECT := # Set to your project name
LOCALPATH := $(CURDIR)/$(PROJECT)
PYTHONPATH := $(LOCALPATH)/
PYTHON_BIN := $(VIRTUAL_ENV)/bin
# Export targets not associated with files
@raymelon
raymelon / docx2md.md
Created December 8, 2017 02:06 — forked from aembleton/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution