/*jslint latedef:false*/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Article = require('./models/article'); | |
function getArticles(callback) { | |
callback = callback || function () {}; | |
return new Promise((resolve, reject) => { | |
Article.find({}, (err, articles) => { | |
if(err) { | |
reject(err); | |
return callback(err); | |
} |
openssl genrsa -out server-key.pem 1024
openssl req -new -key server-key.pem -out server-csr.pem
openssl x509 -req -in server-csr.pem -signkey server-key.pem -out server-cert.pem
- Clone your repository
$ git clone <bitbucket-repo-url>
- Add the remote origin for openshift
Your local clone has then your other repo (bitbucket etc.) as remote repo. Your remote repo is stored with the alias "origin" (the default alias used by git if you clone). You then add the openshift repo as remote to your clone. You do that while explicitly using an alias for the remote repo you add - I'm using "openshift" as alias here:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array3 = _.without(array3, _.findWhere(array3, {_id: push._id})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class VigenereCipher { | |
constructor(key) { | |
this.key = key; | |
} | |
crypt(text) { | |
var cypher = ''; | |
text = text.toUpperCase(); |
$ sudo apt-get install python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev
$ pip install scrapy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(Coupon) { | |
Coupon.status = function(cb) { | |
var currentDate = new Date(); | |
Coupon.count({expiredDate: {gt : currentDate}}, function(err, nbCoupons) { | |
return cb(err, nbCoupons); | |
}); | |
}; | |
Coupon.expirationStatus = function(couponId, cb) { | |
var currentDate = new Date(); | |
Coupon.findById(couponId, function(err, instance) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_file(datafile): | |
name = "" | |
data = [] | |
with open(datafile,'rb') as f: | |
r = csv.reader(f) | |
name = r.next()[1] | |
header = r.next() | |
data = [row for row in r] | |
return (name, data) |