This file contains 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
/* | |
* Javascript makeslug() | |
* by J. Santos <jefrey[at]jefrey[dot]ml> | |
*/ | |
/* | |
Usage: | |
string makeslug( string val [, string replaceBy = "-" ] ) | |
Example: |
This file contains 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
//https://atmospherejs.com/froatsnook/request | |
Meteor.methods({ | |
downloadImage: function (imageUrl) { | |
//https://atmospherejs.com/froatsnook/request | |
var result = request.getSync(imageUrl, {encoding: null}); | |
return 'data:image/png;base64,' + new Buffer(result.body).toString('base64'); | |
} | |
}) |
This file contains 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
docker run -d --name web nginx:alpine | |
Then update the restart-policy; | |
docker update --restart=always web | |
docker run -d --name [container] --restart=always -p 8081:8080 [imagename] |
This file contains 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
de | |
a | |
o | |
que | |
e | |
do | |
da | |
em | |
um | |
para |
This file contains 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
There is no way to store an empty object/array/null value. | |
There are also no actual arrays. Array values get stored as objects with integer keys. | |
(If all keys are integers, it will be returned as an array.) | |
Basically, it's one giant tree of hashes with string keys. | |
Simply write a value to any location, and the intermediary locations will automatically come into existance. | |
── Classes ── | |
DataSnapshot : Container for a subtree of data at a particular location. |
This file contains 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'; | |
| |
module.exports = function(app) { | |
return function(req, res, next) { | |
app.service('things').Model.aggregate([{ | |
$match: {} | |
}, { | |
$project: { | |
year: { | |
$year: '$createdAt' |
This file contains 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
// search with regex | |
query = { fieldName: { $regex: 'pattern', $options: 'igm' } } |
This file contains 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
FROM node:argon | |
RUN apt-get update | |
RUN apt-get install -y less | |
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash | |
ENV NVM_DIR=/root/.nvm | |
ENV SHIPPABLE_NODE_VERSION=v4.2.2 | |
RUN . $HOME/.nvm/nvm.sh && nvm install $SHIPPABLE_NODE_VERSION && nvm alias default $SHIPPABLE_NODE_VERSION && nvm use default && npm install gulp babel jasmine mocha serial-jasmine serial-mocha aws-test-worker -g |
This file contains 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'; | |
const authentication = require('feathers-authentication'); | |
const jwt = require('feathers-authentication-jwt'); | |
const local = require('feathers-authentication-local'); | |
const oauth2 = require('feathers-authentication-oauth2'); | |
const GithubStrategy = require('passport-github'); | |
// Bring in the oauth-handler | |
const makeHandler = require('./oauth-handler'); |
This file contains 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
<nav className='navbar'> | |
{ | |
userRole === 'admin' && ( | |
<AdminPanel /> | |
) || userRole === 'user' && ( | |
<UserPanel /> | |
) || ( | |
<StatusPanel /> | |
) | |
} |
OlderNewer