Skip to content

Instantly share code, notes, and snippets.

@jremi
jremi / SimpleWallet.sol
Created September 13, 2021 06:57
SimpleWallet.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract SimpleWallet {
address private owner;
struct AccountAllowancePermission {
uint maxWithdrawalAmount;
@jremi
jremi / node_nginx_ssl.md
Created May 1, 2021 16:24 — 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

@jremi
jremi / mini-dom-select.js
Last active April 4, 2021 01:22
mini element selector plugin
const myPlugin = function(domSelector) {
const el = document.querySelector(domSelector);
return {
text(text) {
el.innerText = text;
return this;
},
color(color) {
el.style.color = color;
@jremi
jremi / proxy-2way-binding.js
Last active March 29, 2021 05:54
Simple Two Way Binding Using JS Proxy and DOM inputs
/*
Example HTML:
Name: <input v-model="name" />
Age: <input v-model="age" />
Color: <input v-model="color" />
*/
@jremi
jremi / simple-subject-observer-es6.js
Last active November 15, 2020 21:09
simple es6 style subject/observer attach/detach
class Subject {
constructor() {
this.observers = [];
}
attach(observer) {
this.observers.push(observer);
}
detach(observer) {
this.observers = this.observers.filter((obs) => obs !== observer);
}
@jremi
jremi / simple-pubsub-es6.js
Created November 15, 2020 20:08
Super simple es6 class pubsub
class Publisher {
constructor() {
this.subscribers = [];
}
addSubscriber(subscriberInstance) {
this.subscribers.push(subscriberInstance);
}
emit(eventName, payload) {
@jremi
jremi / simple-chatroom.js
Last active November 15, 2020 18:51
Simple es6 javascript chatroom fiddle
class ChatRoom {
constructor(roomName) {
if (!roomName)
throw new Error(
"ChatRoom name must be provided to create new chat room instance!"
);
this.roomName = roomName;
this.roomMembers = [];
}
@jremi
jremi / resume.json
Last active May 25, 2023 19:44
Resume
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Jremi",
"label": "Full-Stack Developer",
"summary": "I’m a remote full-stack Javascript developer with a frontend focus utilizing Vue.js",
"website": "https://jzbg.dev",
"picture": "https://avatars.githubusercontent.com/u/5322988",
@jremi
jremi / SuperSimpleHtmlTemplateLoaderExpress.js
Created March 18, 2019 21:29
Super Simple Static HTML template loader for Express JS
/*
Add your html files inside the folder ./html
For example
-- index.html
-- about.html
When the Express server starts it auto loads all of the HTML template data,
and automatically creates GET routes using the name of each html file.
@jremi
jremi / vuejs-custom-filters-loader.js
Last active March 17, 2019 06:26
Vue.js - Global Custom Filters Loader Library
// [main.js]
import Vue from 'vue'
import filters from './customFilters'
// Load all custom filters into Vue.js
filters._helper.loadAllCustomFilters(Vue);
// Load specific filter "a la carte"
// Example: below loads "letterspace" only