$ docker
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
# Official framework image. Look for the different tagged releases at: | |
# https://hub.docker.com/r/library/node/tags/ | |
image: node:6 | |
before_script: | |
- npm install | |
# This folder is cached between builds | |
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache | |
cache: |
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
<?php | |
$random = rand(); | |
$date = date('Y-m-d H:i:s'); | |
$report_to_file = true; | |
$report_page = "./csp.php?report=1"; | |
$report_file_name = "report.txt"; | |
$intercom_app_id = "YOUR_APP_ID"; |
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
/** | |
* Component that loads script. | |
* It gives you a callback, so you can continue doing stuff once script get loaded. | |
*/ | |
export interface mapWrapperProps{ | |
asyncScriptOnLoad?:()=>void; | |
libraries?:string; | |
} |
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
"husky": { | |
"hooks": { | |
"pre-commit": "lint-staged" | |
} | |
}, | |
"lint-staged": { | |
"*.{js,jsx}": "eslint --cache --fix" | |
}, | |
/** |
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
// This optional code is used to register a service worker. | |
// register() is not called by default. | |
// This lets the app load faster on subsequent visits in production, and gives | |
// it offline capabilities. However, it also means that developers (and users) | |
// will only see deployed updates on subsequent visits to a page, after all the | |
// existing tabs open on the page have been closed, since previously cached | |
// resources are updated in the background. | |
// To learn more about the benefits of this model and instructions on how to |
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
let characterResponse = await fetch('http://swapi.co/api/people/2/') | |
let characterResponseJson = await characterResponse.json() | |
let films = await Promise.all( | |
characterResponseJson.films.map(async filmUrl => { | |
let filmResponse = await fetch(filmUrl) | |
return filmResponse.json() | |
}) | |
) | |
console.log(films) |
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
Show hidden characters
{ | |
"presets": [ | |
["@babel/preset-env", { | |
"modules": false, | |
"useBuiltIns": "entry", | |
"targets": { | |
"browsers": [ | |
"> 0.25%", | |
"not dead" | |
], |
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
export const populateUserActions = (userCuid, period = { from: new Date(), to: null }) => { | |
const aggregation = [ | |
{ $match: { 'cuid': userCuid }}, | |
{ $lookup: CompanyLookup }, | |
{ $lookup: FundraisingLookup }, | |
{ $lookup: MissionLookup }, | |
{ $lookup: CreatedExperienceLookup }, | |
{ $lookup: SubscribedExperienceLookup }, | |
{ $project: { | |
...simpleUserProjection, |
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
// Find one and remove entity afterwards | |
Charity.findOne({ cuid: userCuid }); | |
.exec() | |
.then(entity => { | |
if (!entity) res.status(404).end(); | |
else { | |
entity.remove() | |
.then(() => res.status(204).end()); | |
} | |
}); |