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
| #!/usr/bin/env node | |
| const fs = require('fs'); | |
| const file = '/path/to/file.json'; | |
| fs.watch(file, (eventType, filename) => { | |
| fs.readFile(file, 'utf8', function (err, data) { | |
| if (err) throw err; | |
| process.env.DATA = data; |
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
| <!DOCTYPE html> | |
| <html lang="en" dir="ltr"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title>AS Roma | Official Website | Rome | Football | Soccer | Calcio</title> | |
| <link rel="stylesheet" href="css/main.css"> | |
| <meta name="description" content="Thee AS Roma official website"> | |
| </head> |
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
| # INIT A NEW REPO | |
| git init | |
| git add . | |
| git commit -m "first commit" | |
| git remote add origin git@github.com:<REPO>.git | |
| git push -u origin master | |
| # SECURITY ON GIT | |
| Remove Sensitive Data: https://help.github.com/articles/remove-sensitive-data/ | |
| Sensitive information can include, but is not limited to: |
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
| const cluster = require('cluster'); | |
| const numCPUs = require('os').cpus().length; | |
| const express = require('express') | |
| const app = express(); | |
| const port = 3000; | |
| app.get('/', (req, res) => res.send('Hello World!')); | |
| if (cluster.isMaster) { |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
| <title>User Agent Override</title> | |
| </head> | |
| <body> |
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
| let logger; | |
| if (typeof window === 'undefined') { | |
| logger = await import('./serverLogger'); | |
| } else { | |
| logger = await import('./clientLogger'); | |
| } | |
| export default logger; |
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
| const aws = require("aws-sdk"); | |
| const cloudwatchlogs = new aws.CloudWatchLogs({ | |
| region: "eu-west-1", | |
| }); | |
| const m = { | |
| requestMethod: 'get', | |
| timestamp: 123432039483, | |
| status: '200' |
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
| function J = costFunction(X, y, theta) | |
| % Compute cost for linear regression | |
| % J = costFunction(X, y, theta) computes the cost of using theta as the | |
| % parameter for linear regression to fit the data points in X and y | |
| % Initialize some useful values | |
| m = length(y); % number of training examples | |
| % Compute the cost | |
| J = sum((X * theta - y).^2) * 1/(2*m); | |
| % ========================================================================= |
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 React, { memo } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { Switch, Route, withRouter } from 'react-router-dom'; | |
| import HomePage from './HomePage'; | |
| import NotFoundPage from './NotFoundPage'; | |
| class PageSwitcher extends React.PureComponent { | |
| static propTypes = { | |
| location: PropTypes.object.isRequired |
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
| artillery quick --insecure --count 100 -n 50 https://domain.com | |
| artillery run --insecure --output report.json --target https://example.co.uk config.yaml | |
| https://clinicjs.org/ | |
| https://nodesource.com/ | |
| https://github.com/wg/wrk |
OlderNewer