Skip to content

Instantly share code, notes, and snippets.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@jxhncxmpbxll
jxhncxmpbxll / gist:335e25708b0a829bd9ad77b9a7715f0b
Created December 23, 2020 01:02
Horizontal Scrolling Slider With Directional Button Click
class Slider extends React.Component {
constructor(props) {
super(props);
this.x = 0;
this.state = {
arrowLeft: false,
arrowRight: true
};
this.slider = React.createRef();
}
@jxhncxmpbxll
jxhncxmpbxll / nginx-config-1
Created December 19, 2020 04:27
NGINX Configuration (used)
upstream services {
server 172.31.19.41:3002;
server 172.31.31.127:3002;
server 172.31.16.133:3002;
server 172.31.28.242:3002;
server 172.31.25.222:3002;
server 172.31.21.58:3002;
server 172.31.17.65:3002;
server 172.31.16.80:3002;
  }
@jxhncxmpbxll
jxhncxmpbxll / proxy-stress-test.json
Created December 13, 2020 04:53
sdc-proxy-stress-test
{
"config": {
"target": "http://localhost:3000",
"phases": [
{
"duration": 60,
"arrivalRate": 250
}
]
},
@jxhncxmpbxll
jxhncxmpbxll / stress-test.json
Created December 13, 2020 03:36
sdc-artillery-test
{
"config": {
"target": "http://localhost:3002",
"phases": [
{
"duration": 60,
"arrivalRate": 250
}
]
},
@jxhncxmpbxll
jxhncxmpbxll / index.test.js
Created November 17, 2020 05:14
Testing Server and Database with Jest
const app = require('../server/index.js');
const request = require('supertest');
jest.setTimeout(5000);
test('should respond with an array of objects', async (done) => {
const res = await request(app).get('/api/similar');
const response = JSON.parse(res.text);
const allObjects = response.every((item)=> typeof item === 'object');
@jxhncxmpbxll
jxhncxmpbxll / similar-homes-get
Last active November 14, 2020 00:06
Response to GET request to '/api/similar'
[
{
"_id": "5faf1f26575f2e102456d1fe",
"streetAddress": "951 Natalia Pike",
"streetName": "Abernathy Lock",
"state": "The North",
"zipcode": "75617",
"neighborhood": "Last Hearth",
"city": "Winterfell",
"bedrooms": 2,
@jxhncxmpbxll
jxhncxmpbxll / app.jsx
Created November 11, 2020 06:13
sample React app.jsx file
import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
value: 'example'
};
@jxhncxmpbxll
jxhncxmpbxll / index.html
Last active November 11, 2020 06:34
index.html setup for React
<!DOCTYPE html>
<html>
<head>
<title>React App</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="bundle.js"></script>
</body>