Skip to content

Instantly share code, notes, and snippets.

View Prateek479's full-sized avatar

Prateek Ojha Prateek479

View GitHub Profile
@Prateek479
Prateek479 / async.js
Created March 20, 2016 16:43
Async parallel forEach and async forEach
function asyncParForEach(array, fn, callback) {
var completed = 0;
if (array.length === 0) {
callback(); // done immediately
}
array.forEach(function(data) {
fn(data, function() {
completed++;
if (completed === array.length) {
tinymceOptions = {
menubar: !1,
toolbar: "bold italic underline | alignleft aligncenter alignright | bullist numlist | indent outdent | link unlink image | fullscreen",
width: 578,
height: 400,
resize: !1,
style_formats: [{
title: "Headers",
items: [{
title: "Header 1",

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

/**
* List of Posts
*/
exports.all = function(req, res) {
// async.waterfall([
// function(done) {
var query;
var group_list = req.user.groups;
group_list.push(null);