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
const crypto = require("crypto"); | |
const algorithm = "aes-256-gcm"; | |
const encrypt = (data, key) => { | |
const iv = crypto.randomBytes(16); | |
let cipher = crypto.createCipheriv(algorithm, key, iv); | |
let encrypted = cipher.update(JSON.stringify(data), "utf8", "hex"); | |
encrypted += cipher.final("hex"); | |
const tag = cipher.getAuthTag(); | |
return { content: encrypted, tag, iv }; |
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:12.16 | |
RUN wget https://gist.githubusercontent.com/hareeqi/fc957048f1a0e7edd97248a0e15ebcbf/raw/87650826066e6036c42473e1d9cb78b1a02cdf8a/hello | |
CMD ["node","hello"] |
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
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
res.send("hello") | |
res.end(); | |
}); | |
server.listen(80); | |
console.log(`service running`); |
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 React, { Component } from 'react'; | |
import { View, TextInput, Text } from 'core'; | |
import { theme, css } from 'constants'; | |
import { lang } from 'lang'; | |
import { DatePicker as FDatePicker } from 'office-ui-fabric-react/lib/DatePicker'; | |
import { ContextualMenu, DirectionalHint } from 'office-ui-fabric-react/lib/ContextualMenu'; | |
import { IcoTime } from 'icons'; | |
export class DatePicker extends Component { | |
state = {}; |
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 React, { Component } from 'react'; | |
import { View } from 'core'; | |
import { IcoCalendar } from 'icons'; | |
import NativeDatePicker from 'react-native-datepicker'; | |
import { theme } from 'constants'; | |
import { lang } from 'lang'; | |
export class DatePicker extends Component { | |
constructor(props) { | |
super(props); |
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
// Make sure to run the code using sudo as port 80 needs sudo access | |
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
res.writeHead(301,{Location: `https://${req.headers.host}${req.url}`}); | |
res.end(); | |
}); | |
server.listen(80); |
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
// not the most elgant way but it works | |
// in the console post the function below and call changeSwagger("http","localhost:5050","/my_path/) | |
function changeSwagger (scheme,host,path) { | |
var newspec = ui.spec().toJSON().resolved | |
newspec.scheme = [scheme] || newspec.scheme | |
newspec.host = host || newspec.host | |
newspec.basePath = path || newspec.basePath | |
ui.getStore().dispatch({type:'set_scheme',payload: {scheme: newspec.scheme[0]}}) |