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
function weekToDate(year, wn, dayNb){ | |
var j10 = new Date( year,0,10,12,0,0), | |
j4 = new Date( year,0,4,12,0,0), | |
mon1 = j4.getTime() - j10.getDay() * 86400000; | |
return [ | |
new Date(mon1 + ((wn - 2) * 7 + dayNb) * 86400000), | |
new Date(mon1 + ((wn - 1) * 7 + dayNb-1) * 86400000), | |
] | |
}; |
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
function getWeekNumber(d) { | |
d = new Date(+d); | |
d.setHours(0,0,0); | |
d.setDate(d.getDate() + 4 - (d.getDay()||7)); | |
var yearStart = new Date(d.getFullYear(),0,1); | |
var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7); | |
return [d.getFullYear(), weekNo]; | |
} | |
// Exemple: |
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
#!/bin/bash | |
echo "Welcome to listen script" | |
echo "Check if process restart" | |
MJ_APIKEY_PUBLIC="*****" | |
MJ_APIKEY_PRIVATE="*****" | |
SENDER_EMAIL="contact@*****.com" | |
RECIPIENT_EMAIL="devteck@*****.com" |
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
{ | |
"version":"0.1", | |
"uploadKeys":[ | |
{ | |
"name":"EMDR", | |
"key":"CREST" | |
} | |
], | |
"rowsets":[ | |
{ |
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
import originalInkjet from 'inkjet'; | |
const EXIF_TRANSFORMS = { | |
1: { rotate: 0, flip: false }, | |
2: { rotate: 0, flip: true }, | |
3: { rotate: Math.PI, flip: false }, | |
4: { rotate: Math.PI, flip: true }, | |
5: { rotate: Math.PI * 1.5, flip: true }, | |
6: { rotate: Math.PI * 0.5, flip: false }, | |
7: { rotate: Math.PI * 0.5, flip: true }, |
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
{ | |
"workbench.colorTheme": "One Dark Pro", | |
"atomKeymap.promptV3Features": true, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.formatOnPaste": true, | |
"workbench.iconTheme": "material-icon-theme", | |
"prettier.eslintIntegration": true, | |
"prettier.trailingComma": "all", | |
"prettier.singleQuote": true, | |
"workbench.startupEditor": "newUntitledFile", |
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
{ | |
"compilerOptions": { | |
"jsx": "react", | |
// This must be specified if "paths" is set | |
"baseUrl": ".", | |
// Relative to "baseUrl" | |
"paths": { | |
// exemple: "*": ["*", "web_modules/*", "web_modules/shared/*", "test/*"] | |
} | |
} |
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
import { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
// wait apollo 2.1 | |
export default class ApolloQuery extends Component { | |
state = { data: undefined, rest: {}, loading: false }; | |
componentWillMount() { | |
const { query, variables } = this.props; | |
this.query(query, variables); |
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
import PropTypes from 'prop-types'; | |
/* | |
ApolloQueryPromise(client<context>, query<string>, variables<object>, { | |
skip: ownProps => ownProps.skip, | |
}) | |
.then((data, res) => console.log('data', data, res)) | |
.catch(error => { ... }); | |
*/ | |
const ApolloQueryPromise = (client, query, variables = {}, config = {}) => |