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
// Maximum depth is 3, after that we get a "" error from Parse | |
function getUserRoles(user) { | |
var queries = [ | |
new Parse.Query('_Role').equalTo('users', user) | |
]; | |
for (var i = 0; i < 2; i++) { | |
queries.push(new Parse.Query('_Role').matchesQuery('roles', queries[i])); | |
} | |
return user.rolesPromise = Parse.Query.or.apply(Parse.Query, queries).find().then( |
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 bcrypt = require('bcrypt'); | |
var HASH_ROUNDS = 10; | |
module.exports = function RedditAPI(conn) { | |
return { | |
createUser: function createUser(user, callback) { | |
// first we have to hash the password... | |
bcrypt.hash(user.password, HASH_ROUNDS, function(err, hashedPassword) { | |
if (err) { |
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
Parse.Promise.prototype.toJqueryPromise = function() { | |
var def = jQuery.Deferred(); | |
this.then( | |
def.resolve.bind(def), | |
def.reject.bind(def) | |
); | |
return def.promise(); | |
} |
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
@import "compass/css3/shared"; | |
// NOTE: | |
// All mixins for the 2009 spec have been written assuming they'll be fed property values that | |
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't | |
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009 | |
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins | |
// indexing at 0. | |
// if `true`, the 2009 properties will be emitted as part of the normal mixin call |
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
[submodule "amqp"] | |
path = amqp | |
url = http://github.com/ry/node-amqp.git |
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'; | |
const express = require('express'); | |
const app = express(); | |
const port = process.env.PORT || 4001; | |
const rabbit = { | |
generateMessage: function(nbMessage) { | |
let lists = []; | |
for (let i = 0; i < nbMessage; i++) { |
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
[ | |
{ | |
"invoiceId": 1, | |
"createdDate": "3/27/2018", | |
"dueDate": "5/24/2019", | |
"address": "28058 Hazelcrest Center", | |
"companyName": "Eayo", | |
"invoiceName": "Carbonated Water - Peach", | |
"price": 376 | |
}, |
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
/** | |
* @description Hacky implementation for ignoring | |
* @param {Function} callback | |
* @param {Array of primitive dependencies} deps, because | |
* Arrays & Objects don't work in useEffect deps | |
*/ | |
const useIgnore = (callback, deps) => { | |
const [{success, error, loading}, setState] = React.useState({ | |
success: null, | |
error: null, |
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
/* eslint-disable*/ | |
const merge = require('webpack-merge'); | |
const baseConfig = require('./base.config'); | |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | |
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
const WebpackVisualizer = require('webpack-visualizer-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const productionConfig = env => { | |
return merge([ |
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
import 'docs/src/modules/components/bootstrap'; | |
// --- Post bootstrap ----- | |
import React from 'react'; | |
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | |
const req = require.context('markdown', true, /.md$/); | |
/* | |
APPRAOCH #1 DOES NOT WORK! HANGS SYSTEM |