Skip to content

Instantly share code, notes, and snippets.

View THEozmic's full-sized avatar
🏠
Working from home

Michael Ozoemena THEozmic

🏠
Working from home
View GitHub Profile
export default (sequelize, DataTypes) => {
const Users = sequelize.define('Users', {
username: {
allowNull: false,
type: DataTypes.STRING,
unique: true,
validate: {
notEmpty: true
}
},
...
fetchMe(req, res) {
const username = req.decoded.data;
return models.Users
.find({
include: [{
model: models.Groups,
as: 'groups',
required: false,
{
"id": 1,
"username": "John",
"phone": "xxxxxxxxx",
"email": "John@email.com",
"createdAt": "2017-07-16T20:14:04.744Z",
"updatedAt": "2017-07-16T20:14:04.744Z",
"groups": [
{
"id": 2,
@THEozmic
THEozmic / Second.js
Last active September 17, 2017 13:11
alert('Hello Human');
alert('You shall die');
@THEozmic
THEozmic / Button.jsx
Last active October 12, 2017 22:10
VougePay React Lib
import React from 'react';
const Button = ({ image, btnClass }) =>
(
{
image ? <input type='image' src={image} alt='Submit' className={btnClass} /> :
<input type='submit' alt='Submit' className={btnClass}/>
}
);
@THEozmic
THEozmic / Search.jsx
Last active November 28, 2017 09:04
Search Component that lets users search, select search results and submit selected results
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { Form } from './Form';
import {
apiFetchGroup,
apiSearch,
apiUpdateMembers,
stopSearch } from '../../actions/';
@THEozmic
THEozmic / index.js
Last active February 5, 2018 14:49
// Hello M
const mimeType = 'text/plain';
const filename = JSON.parse(localStorage.getItem('pads'))[JSON.parse(localStorage.getItem('selected_pad')).id].content.substring(0,8)
const elId = "typing"
const elHtml = document.getElementById(elId).innerHTML;
if (navigator.msSaveBlob) {
navigator.msSaveBlob(new Blob([elHtml], { type: mimeType + ';charset=utf-8;' }), filename);
} else {
const link = document.createElement('a');
link.setAttribute('download', filename);
"scripts": {
"parcel:dev": "./node_modules/.bin/parcel index.html",
"parcel:watch": "./node_modules/.bin/parcel watch index.html",
"parcel:build": "./node_modules/.bin/parcel build index.html"
}
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
module('Acceptance | simple form', function(hooks) {
setupApplicationTest(hooks);
test('visiting /simple-form', async function(assert) {
await visit('/simple-form');