Skip to content

Instantly share code, notes, and snippets.

View emmsdan's full-sized avatar
💫
. if you can you think? then I can build it...

Emmanuel Daniel emmsdan

💫
. if you can you think? then I can build it...
View GitHub Profile
@emmsdan
emmsdan / README-Template.md
Created August 18, 2018 17:25 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@emmsdan
emmsdan / user.spec.js
Last active March 20, 2019 01:19
test if a user already exists
import chai from 'chai';
import chaiHttp from "chai-http";
import { app as server } from './app.js';
// configure chai to send/receive HTTP REQUEST
chai.use(chaiHttp);
describe("TDD for Users", () => {
after(() => {
server.close();
//tables
define async createTag(tags, articleid):
# schema tags = [{ tagid, tagname }]
// articles { articleid ....}
// article_tag { tagid, articleid }
try {
// Result is whatever you returned inside the transaction
let result = await sequelize.transaction( async (t) => {
updateArticle (req, res);
updateArticle =>
const { tags, title, description, body, images } = res.body;
const updatedArticle = Articles.update(
{ tags, title, description, body, images },
{ where: { id: 'sdfw3edcs-dc-xwedsvc-ew' } });
const palindrome = (words) => {
if (typeof words !== 'string') return 'provide a string or a phrase';
const wordArray = words.replace(/([^\w])/g, '').split('');
return checkPalindrome(wordArray);
}
function checkPalindrome(arrayOfChars) {
if (!Array.isArray(arrayOfChars)) return 'please provide an array';
if (arrayOfChars.join('') === arrayOfChars.reverse().join('')) return 'this is a palindrome';
return 'this is not a palindrome';

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@emmsdan
emmsdan / cookie.io.ts
Last active June 13, 2019 09:13
simple application that allows people to add evidence of completion before a task is marked as completed.
const features = [
'can record video',
'can upload video to cloud',
'can search video',
'can start, stop and switch video outputs'
]
const screens = {
type: ['galary', 'analyst']
}
@emmsdan
emmsdan / cloudSettings
Last active December 14, 2019 08:54
settings for my vscode
{"lastUpload":"2019-12-14T08:54:20.796Z","extensionVersion":"v3.4.3"}
function generateKeyPad (options, callback) {
const btnSize = {
button: (options.size === 1 ? '15%' : options.size === 2 ? '20%' : '32%') + ' !important',
clear: (options.size === 1 ? '31%' : options.size === 2 ? '41%' : '32%') + ' !important'
}
// Define stylesheet
const styleSheet = `
.input-container {
width: 100% !important;
display: flex !important;