Skip to content

Instantly share code, notes, and snippets.

BPromise.all(friendIdList.filter(Boolean).map(obsId => docClient.queryAsync(params)))
.then(feedList => _.sortBy(_.flatten(feedList), 'timestamp').reverse());
sns.createPlatformEndpointAsync({
PlatformApplicationArn: applicationArn,
Token: deviceId,
});
/* send the notification (not needed) */
sns.publishAsync({
MessageStructure: "json",
Message: JSON.stringify({
APNS: JSON.stringify({
const Promise = require("bluebird");
const docClient = {
put(x, cb) {
setTimeout(() => {
if (1 == x) {
cb(null, "good");
}
else {
cb(new Error("bad"));
}
function authenticateUser(details, callback) {
if (details) {
return callback.onSuccess();
}
return callback.onFailure();
}
new Promise((onSuccess, onFailure) => {
authenticateUser(true, {
onSuccess,
angular.module('starter', ['ionic'])
.run(["LocationService", async LocationService => {
const coords = await LocationService.getPosition();
console.log(coords);
}])
.service("LocationService", ["$window", "$q", ($window, $q) => (
{
getPosition() {
const dfd = $q.defer();
const express = require("express");
const userRouter = express.Router();
const groupRouter = express.Router();
const app = express();
userRouter.get("/user", (req, res) => res.end("user"));
groupRouter.get("/group", (req, res) => res.end("group"));
app.use("/api", userRouter);
app.use("/api", groupRouter);
redisconfig_1 | _._
redisconfig_1 | _.-``__ ''-._
redisconfig_1 | _.-`` `. `_. ''-._ Redis 3.0.3 (00000000/0) 64 bit
redisconfig_1 | .-`` .-```. ```\/ _.,_ ''-._
redisconfig_1 | ( ' , .-` | `, ) Running in standalone mode
redisauth_1 | _._
redisconfig_1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
redisauth_1 | _.-``__ ''-._
redisconfig_1 | | `-._ `._ / _.-' | PID: 1
redisauth_1 | _.-`` `. `_. ''-._ Redis 3.0.3 (00000000/0) 64 bit
#!/bin/bash
cd /home/ec2-user/ingest
./run.sh
aws --region=us-east-1 autoscaling terminate-instance-in-auto-scaling-group --instance-id $(curl http://169.254.169.254/latest/meta-data/instance-id) --should-decrement-desired-capacity
import delay from "timeout-as-promise"
(async () => {
let actions = (new Array(50)).fill(0).map(() => Math.random() * (1000 - 500) + 500);
let promises = [];
try {
actions.forEach(time => promises.push(
async () => {
try {
const fs = require("fs");
const JSONStream = require("JSONStream");
const parser = JSONStream.parse('*');
const stream = fs.createReadStream("./bl");
stream.pipe(parser);
parser.on("data", data => {
let len = Buffer.byteLength(data.result);
if (len > 500000) {