Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Meditating

Harry Dbrandy devdbrandy

🎯
Meditating
View GitHub Profile
@devdbrandy
devdbrandy / deliver_stories.rb
Last active Nov 20, 2018
Deliver stories script for pivotaltracker
View deliver_stories.rb
#!/usr/bin/env ruby
# gem 'pivotal-tracker'
require 'pivotal-tracker'
TRACKER_TOKEN = "..."
TRACKER_PROJECT_ID = "..."
PivotalTracker::Client.token = TRACKER_TOKEN
PivotalTracker::Client.use_ssl = true
@devdbrandy
devdbrandy / agile_guides.md
Last active Nov 20, 2018
Agile Guides: User story examples
View agile_guides.md

Agile Guides

User stories examples

User Story Examples

Samples

  • As a user, I can view the license terms before purchasing or subscribing so that I know what I’m getting.
  • As an app user, I can read FAQs, so I can get quick answers.
  • As a website admin, I want all the offers to get unpublished on the website after 7 days of publishing so that the expired offers are not still listed if I forget to delete them.
@devdbrandy
devdbrandy / User.js
Last active Mar 24, 2019
Sequelize User model in es6
View User.js
import Sequelize from 'sequelize';
/**
* A model class representing user resource
*
* @param {Sequelize} sequelize - Sequelize object
* @param {Sequelize.DataTypes} DataTypes - A convinient object holding data types
* @return {Sequelize.Model} - User model
*/
export default (sequelize, DataTypes) => {
@devdbrandy
devdbrandy / jsconfig.js
Created Oct 3, 2019
Code editor mappings for NodeJS module resolvers (custom alias)
View jsconfig.js
{
"compilerOptions": {
"baseUrl": ".",
"target": "es6",
"module": "commonjs",
"paths": {
"@config/*": ["src/config/*"],
"@database/*": ["src/database/*"],
"@factories/*": ["src/database/factories/*"],
"@helpers/*": ["src/helpers/*"],
@devdbrandy
devdbrandy / jsconfig.js
Last active Oct 3, 2019
A sample of code editor mappings for NodeJS module resolvers (custom alias)
View jsconfig.js
{
"compilerOptions": {
"baseUrl": ".",
"target": "es6",
"module": "commonjs",
"paths": {
"@config/*": ["src/config/*"],
"@database/*": ["src/database/*"],
"@factories/*": ["src/database/factories/*"],
"@helpers/*": ["src/helpers/*"],
@devdbrandy
devdbrandy / app.js
Created Dec 5, 2018
Simple Express API
View app.js
/* eslint-disable */
const express = require('express');
const app = express();
app.use(express.json());
const db = {
users: [
@devdbrandy
devdbrandy / User.js
Last active Jan 4, 2022
User followers implementation with Sequelize ORM and ExpressJS
View User.js
import bcrypt from 'bcryptjs';
/**
* A model class representing user resource
*
* @param {Sequelize} sequelize - Sequelize object
* @param {Sequelize.DataTypes} DataTypes - A convinient object holding data types
* @return {Sequelize.Model} - User model
*/
export default (sequelize, DataTypes) => {