I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
var express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
var express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
; Autohotkey Capslock Remapping Script | |
; - Deactivates capslock for normal (accidental) use. | |
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar). | |
; - Access the following functions when pressing Capslock: | |
;Cursor keys - h, j, k, l | |
;Home,End - N, ; | |
;Page up,down - - = | |
;Esc - CapsLock only | |
;CapsLock - Space |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
9 March, 2019
We were discussing with @erusev what we can do with async operation when using useReducer()
in our application. Our app is simple and we don't want to use a state management library. All our requirements are satisfied with using one root useReducer()
. The problem we are facing and don't know how to solve is async operations.
In a discussion with Dan Abramov he recommends Solution 3 but points out that things are fresh with hooks and there could be better ways of handling the problem.
name: Node CI | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
upload-release: |