Skip to content

Instantly share code, notes, and snippets.

View wesscoby's full-sized avatar
😎
It does get easier...

Emmanuel Sekyere wesscoby

😎
It does get easier...
View GitHub Profile
@wesscoby
wesscoby / app.js
Created April 24, 2020 01:50 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@wesscoby
wesscoby / README.md
Created September 21, 2019 00:53 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
//! Challenge
/**
* You've just finished writing the last chapter for your novel when a virus suddenly
* infects your document. It has swapped the i's and e's in ei words and capitalized
* random letters. In today's challenge, you will write a function which will:
* a) Remove the spelling errors in 'ei' words. (Examples of 'ei' words: their, caffein, deceive, weight)
* b) Only capitalize the first letter of each sentence.
* Make sure the rest of the sentence is in lowercase
//! Exercise of the day
/**
* Some new cashiers started to work at our restaurant.
* All the orders they create look something like this:
*
** "milkshakepizzachickenfriescokeburgerpizzasandwitchmilkshakepizza"
*
* Their preference is to get the orders as a nice clean string with spaces and capitals like so:
*
** "Burger Fries Chicken Pizza Pizza Pizza Sandwitch Milkshake MilkShake Coke"
{
"basics": {
"name": "Emmanuel Sekyere",
"label": "Fullstack Developer",
"picture": "https://avatars0.githubusercontent.com/u/5289465?s=460&v=4",
"email": "[email protected]",
"phone": "(054) 867-4035",
"website": "http://wesscoby.me",
"summary": "I am currently working as a Logistics Personnel, and also working towards earning a BSc. in Information Technology degree at the University of Ghana. I love learning and engaging in conversations related to Web and Software Development, and emerging technologies. I aspire to become a Full Stack Developer.",
"location": {
@wesscoby
wesscoby / gist:56049522fdce4a33783bb3ed69bfc157
Created June 10, 2019 18:52 — 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:
@wesscoby
wesscoby / commit
Last active May 30, 2019 09:12
A simple bash script to aid in staging and committing files. Meant for #WSL and #Linux Users
#!/bin/bash
# Title : commit
# Date : 16.05.2019
# Author : WessCoby <[email protected]>
# Version : 1.0.2
# Description : A simple bash script to aid in staging and committing files to git
# Options : None
### Git Prefix specifying the current working directory
@wesscoby
wesscoby / csf
Last active May 24, 2019 11:53
Creates a new bash script file in the current working directory. This is meant for #WSL users as it kind of solves the CR [Carriage Return (\r)] and LF [Linefeed (\n)] issue in Windows, since the file will be created in the Linux environment, and not Windows.
#!/bin/bash
# Title : csf
# Date : 17.05.2019
# Author : WessCoby <[email protected]>
# Version : 1.0.0
# Description : Short for 'Create Script File' [A simple bash script creator]
# Creates a new bash script file in the current working directory.
# This kind of solves the CR [Carriage Return (\r)] and LF [Linefeed (\n)] issue in Windows,
# since the file will be created in a Unix environment, and not Windows.
@wesscoby
wesscoby / rename.js
Created April 15, 2019 06:22 — forked from scriptex/rename.js
Rename all files in a folder with NodeJS
const fs = require('fs');
const path = require('path');
const args = process.argv.slice(2);
const dir = args[0];
const match = RegExp(args[1], 'g');
const replace = args[2];
const files = fs.readdirSync(dir);
files
.filter(file => file.match(match))
@wesscoby
wesscoby / categorizeData.js
Created April 13, 2019 19:31
Categorize data(an array of objects) based on a specified category (a property in the data)
/*
* Categorize data based on a specified category (a property in the data)
* @data an array of objects
* @category the criteria for categorizing the @data. @category must be a property in @data
*/
module.exports = (data, category) => {
// Get the category list with which to categorize the data
// getCategoryList is assigned to an iife
let getCategoryList = (() => {