Skip to content

Instantly share code, notes, and snippets.

View jhony112's full-sized avatar

Jhony Babs jhony112

View GitHub Profile
select * from boy
@jhony112
jhony112 / question.js
Last active November 27, 2019 08:59 — forked from sunnexy/question.js
const mongoose = require('mongoose');
const questionSchema = mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
createdOn: { type: Date, default: Date.Now },
createdBy: { type: String, ref: 'User' }, // represents the user asking the question
meetup: { type: mongoose.Schema.Types.ObjectId, ref: 'Meetup', required: true }, // represents the meetup the question is for
title: { type: String },
bodyMessage: { type: String },
function alphaID($in, $to_num = false, $pad_up = false, $pass_key = null)
{
$out = '';
$index = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$base = strlen($index);
if ($pass_key !== null) {
// Although this function's purpose is to just make the
// ID short - and not so much secure,
// with this patch by Simon Franz (http://blog.snaky.org/)
@jhony112
jhony112 / socket.js
Created July 7, 2017 06:03
socket js
const http = require("http");
const https = require("https");
const co = require("co");
const fs = require("fs");
const url = require("url");
const querystring = require("querystring");
const MongoClient = require("mongodb").MongoClient;
const ObjectID = require("mongodb").ObjectID;
let config, db, deployment, io, server;
@jhony112
jhony112 / tremen.js
Last active July 7, 2017 11:59
for josh
var signal = {
//server: "localhost",
server: "http://habari-test.gtbank.cloud",
start: function (uid, onConnectCallback) {
if (!signal.isConnected) {
signal.isConnected = true;
console.log("connected");
socket.on('login_status', function (connection) {