Skip to content

Instantly share code, notes, and snippets.

View setup.bash
#!/bin/bash
# essentials
sudo apt-get install git curl emacs24 vim cowsay
# sublime
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
@pavel-shvetsov
pavel-shvetsov / meteor_mongodb_search.coffee
Last active Sep 1, 2015
Simple mongodb search with meteor by using regular expressions. It tries to match all provided fields with the provided keywords. Inspired from http://www.stephentcannon.com/2013/11/meteor-alternative-to-mongodb-full-text.html
View meteor_mongodb_search.coffee
RegExp.quote = (str) ->
(str + "").replace /([.?*+^$[\]\\(){}|-])/g, "\\$1"
Meteor.Collection::search = (options, cb) ->
if options?.keywords?.length >= 3 and _.isString(options.keywords) and options.fields.length >= 1
query =
'$or': []
keywords = options.keywords.split " "
View save_file_server_side
/*
|
|
| THANKS Fats! he did the hard work
|
|
*/
/*
|