Skip to content

Instantly share code, notes, and snippets.

@nenjotsu
nenjotsu / diagrams.md
Created December 23, 2022 00:58 — forked from blackcater/diagrams.md
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@nenjotsu
nenjotsu / node_nginx_ssl.md
Created March 27, 2022 15:20 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@nenjotsu
nenjotsu / deno-strapi-sample.tsx
Last active October 11, 2021 11:44
deno-strapi-sample
// @ts-nocheck
// @ts-ignore
/// <reference path="https://raw.githubusercontent.com/denoland/deployctl/main/types/deploy.fetchevent.d.ts" />
/// <reference path="https://raw.githubusercontent.com/denoland/deployctl/main/types/deploy.window.d.ts" />
// @ts-ignore
import * as React from "https://esm.sh/[email protected]";
// @ts-ignore
import * as ReactDOMServer from "https://esm.sh/[email protected]/server";
// @ts-ignore
@nenjotsu
nenjotsu / index.js
Created November 5, 2018 05:35
advanced-redux-pattern
// src/index.js
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import List from "antd/lib/list";
import Icon from "antd/lib/icon";
import store from "./redux/store";
import SampleModule from "./containers/sample-module";
import "antd/dist/antd.css";
@nenjotsu
nenjotsu / Components with sequence of epics.js
Created November 3, 2018 15:05
Components with sequence of epics
componentDidMount() {
const { reduxActions } = this.props;
reduxActions.getMasterData();
reduxActions.getUserLists();
}
updateUserAssignments = () => {
const { reduxActions } = this.props;
reduxActions.getUserInformation();
reduxActions.updateUserAssignment();
@nenjotsu
nenjotsu / transporter-mongodb-elasticsearch-pipeline.js
Created July 4, 2018 03:46
Transporter Mongodb Elasticsearch pipeline
var source = mongodb({
"uri": "${MONGODB_URI}"
// "timeout": "30s",
// "tail": false,
// "ssl": false,
// "cacerts": ["/path/to/cert.pem"],
// "wc": 1,
// "fsync": false,
// "bulk": false,
// "collection_filters": "{}",
@nenjotsu
nenjotsu / Create Elastic Superuser Account
Last active January 20, 2019 18:11
Create Elastic Superuser Account
curl -H 'Content-Type: application/json' -XPOST -u elastic:<ELASTIC-PASSWORD> 'http://<YOUR-IP>:9200/_xpack/security/user/nenjotsu' -d'
{
"password": "password",
"roles": ["superuser"]
}'
@nenjotsu
nenjotsu / VS Code Settings
Last active March 15, 2018 15:09
VS Code Settings
{
"window.zoomLevel": 0,
"workbench.sideBar.location": "left",
"git.autofetch": false,
"workbench.iconTheme": "vscode-icons",
"editor.tabSize": 2,
"editor.detectIndentation": false,
"window.restoreFullscreen": true,
"window.newWindowDimensions": "fullscreen",
"editor.snippetSuggestions": "top",
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
try
select first window
set onlywindow to false
on error