Skip to content

Instantly share code, notes, and snippets.

var authenticateUser = function(req, res, next) {
User.findOne({ username: req.body.username }, function(errFindUser, user) {
if (errFindUser) return next(errFindUser);
if (user) {
return user.verifyPassword(req.body.password, function(errVerifyPassword, isPasswordMatch) {
if (errVerifyPassword) return next(errVerifyPassword);
if (isPasswordMatch) {
return issueToken(user._id, function(errIssueToken, token) {
var authenticateUser = function(req, res, next) {
User.findOne({ username: req.body.username })
.bind({})
.then(function(user) {
this.user = user;
if (user) {
return user.verifyPassword(req.body.password);
}
return Promise.resolve(false);
})
const authenticateUser = function(req, res, next) {
Promise.coroutine(function*() {
try {
let user = yield User.findOne({ username: req.body.username });
if (user) {
let isPasswordMatch = yield user.verifyPassword(req.body.password);
if (isPasswordMatch) {
let token = yield issueToken(user._id);
const authenticateUser = async function(req, res, next) {
try {
let user = await User.findOne({ username: req.body.username });
if (user) {
let isPasswordMatch = await user.verifyPassword(req.body.password);
if (isPasswordMatch) {
let token = await issueToken(user._id);
res.status(200).send(token);

Keybase proof

I hereby claim:

  • I am victorparmar on github.
  • I am wheresvic (https://keybase.io/wheresvic) on keybase.
  • I have a public key ASB3ulb_DWCsVyqrbpaob1_qR3XeOqZ0AKqK85N3_sfA4Ao

To claim this, I am signing this object:

diff --git a/common/inc/nv.h b/common/inc/nv.h
index d52c2a1..4acebe4 100644
--- a/common/inc/nv.h
+++ b/common/inc/nv.h
@@ -605,31 +605,31 @@ typedef NV_STATUS (*nvPmaEvictRangeCallback)(void *, NvU64, NvU64);
#define NV_TIMERCMP(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) ? \
- ((a)->tv_usec CMP (b)->tv_usec) : ((a)->tv_sec CMP (b)->tv_sec))
+ ((a)->tv_nsec CMP (b)->tv_nsec) : ((a)->tv_sec CMP (b)->tv_sec))
diff --git a/common/inc/nv-list-helpers.h b/common/inc/nv-list-helpers.h
index 0aed851..7d62b92 100644
--- a/common/inc/nv-list-helpers.h
+++ b/common/inc/nv-list-helpers.h
@@ -91,8 +91,8 @@
list_entry((pos)->member.next, typeof(*(pos)), member)
#endif
-static inline int list_is_first(const struct list_head *list,
- const struct list_head *head)
--- a/common/inc/nv-linux.h
+++ b/common/inc/nv-linux.h
@@ -730,8 +730,8 @@ static inline void nv_vunmap(NvUPtr vaddr, NvU32 page_count)
#elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3)
#define NV_ON_EACH_CPU(func, info) \
({ \
- int __ret = on_each_cpu(func, info, 1); \
- __ret; \
+ on_each_cpu(func, info, 1); \
+ 0; \
--- a/nvidia-uvm/uvm8_tools.c
+++ b/nvidia-uvm/uvm8_tools.c
@@ -204,12 +204,14 @@ static bool tracker_is_counter(uvm_tools_event_tracker_t *event_tracker)
return event_tracker != NULL && !event_tracker->is_queue;
}
+/*
static void put_user_pages(struct page **pages, NvU64 page_count)
{
NvU64 i;
@wheresvic
wheresvic / nickname.md
Created April 17, 2020 15:04 — forked from brigand/nickname.md
Freenode Setting Up Your Nickname

What is the recommended way to set up my IRC nickname?

Please follow these steps to set up your nick and configure your client. Check off each step to make sure it's been done:

Select a permanent, master nickname. If the nickname you want is registered but has expired, just ask a staffer and in most cases, we will be happy to drop it for you.

Please avoid using the name of a community project or trademarked entity, to avoid conflicts. Write down your password and be sure to keep the sheet of paper in a safe place.

Register your IRC nick: