Skip to content

Instantly share code, notes, and snippets.

View sumn2u's full-sized avatar
🌎

Suman Kunwar sumn2u

🌎
  • Baltimore
  • 20:15 (UTC -04:00)
View GitHub Profile
@sumn2u
sumn2u / app.js
Created January 10, 2016 04:43
application file
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, list = require('./routes/list.js')
var app = module.exports = express.createServer();
@sumn2u
sumn2u / list.js
Created January 10, 2016 04:45
list file inside routes file
var db = require('../database.js');
//creates a new entry
exports.getList = function(req, res){
db.ListEntry.find(function(err, entries){
if(err){
console.log(err);
}
// console.log(entries);
// var content = {content: entries};
@sumn2u
sumn2u / mongoexam
Created March 2, 2016 04:31
MongDB M101JS final exam
/*
Copyright (c) 2008 - 2016 MongoDB, Inc. <http://mongodb.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@sumn2u
sumn2u / mongoexam
Created March 2, 2016 04:31
MongDB M101JS final exam
/*
Copyright (c) 2008 - 2016 MongoDB, Inc. <http://mongodb.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@sumn2u
sumn2u / ember specific test
Created June 16, 2016 06:21
ember test with filter
ember test --filter "some string to match in test title"
ember test --server --filter "something to match"
@sumn2u
sumn2u / Converting libraries to Ember CLI addons.md
Last active July 14, 2016 06:20 — forked from kristianmandrup/Converting libraries to Ember CLI addons.md
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

import discord
import random
import time
import traceback
import os
from reply_generator import genReply
client = discord.Client()
client.login('******@**', '****')
# Imports
import nltk.corpus
import nltk.tokenize.punkt
import nltk.stem.snowball
from nltk.corpus import wordnet
import string
from chatterbot.adapters.logic import LogicAdapter
class ApproximateSentenceMatchingAdapter(LogicAdapter):
"""
# -*- coding: utf-8 -*-
# Imports
from .base_match import BaseMatchAdapter
import nltk.corpus
import nltk.tokenize.punkt
import nltk.stem.snowball
from nltk.corpus import wordnet
import string
from chatterbot.adapters import Adapter
from fuzzywuzzy import fuzz
var express = require('express')
var bodyParser = require('body-parser')
var request = require('request')
var app = express()
var Mailjet = require('node-mailjet').connect(
process.env.MJ_APIKEY_PUBLIC,
process.env.MJ_APIKEY_PRIVATE
);
app.set('port', (process.env.PORT || 3030))