- 36 Volt UPS (1x 30$). Recommended Tripp Lite Smart 1500. (No Battery needed, we will be replacing it)
- Note: that the UPS must use a 36 volt battery setup. Normally, this is three 12 volt Lead-Acid batteries in series. Trying to use Lithium Batteries on a 12 volt or 24 volt system is dangerous.
- Link: https://erc-green.com/shop?olsPage=products%2Ftripp-lite-smart-1500-950w-ups
- 36 Volt Hoverboard / Scooter Lithium Batteries (4x ~ $30 each)
- These batteries are available on ebay, and are packs made of 20 18650 battieries in a 36 volt (10s2p) configuration.
- They come built in with a BMS to prevent over charging and discharging and balance the cells.
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
// Original JS source: https://github.com/jitbit/HtmlSanitizer/blob/master/HtmlSanitizer.js | |
export class HtmlSanitizer { | |
private _tagWhitelist = { | |
A: true, ABBR: true, B: true, BLOCKQUOTE: true, BODY: true, BR: true, CENTER: true, | |
CODE: true, DD: true, DIV: true, DL: true, DT: true, EM: true, FONT: true, | |
H1: true, H2: true, H3: true, H4: true, H5: true, H6: true, HR: true, I: true, | |
IMG: true, LABEL: true, LI: true, OL: true, P: true, PRE: true, | |
SMALL: true, SOURCE: true, SPAN: true, STRONG: true, SUB: true, SUP: true, TABLE: true, | |
TBODY: true, TR: true, TD: true, TH: true, THEAD: true, UL: true, U: true, VIDEO: 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
// Note: you would only want this to be executed once, and after | |
// the page has loaded. This is just a gist, it can be customized | |
// further | |
// Find all elements where autocomplete="off" | |
document.querySelectorAll('[autocomplete="off"]').forEach( | |
(element) => { | |
// Store the original name of the element | |
const orgininalName = element.getAttribute('name'); |
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
Warming up -------------------------------------- | |
Querying for 1000 objects | |
1.000 i/100ms | |
Calculating ------------------------------------- | |
Querying for 1000 objects | |
6.856 (± 0.0%) i/s - 35.000 in 5.129558s | |
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>ruby-prof call tree</title> | |
<style type="text/css"> |
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
# frozen_string_literal: true | |
TESTING_INTERPRETER = true | |
require "graphql" | |
require "jazz" | |
require "benchmark/ips" | |
require "ruby-prof" | |
require "memory_profiler" | |
module GraphQLBenchmark | |
QUERY_STRING = GraphQL::Introspection::INTROSPECTION_QUERY |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var Benchmark = require('benchmark'); | |
var Q = require('q'); | |
var when = require('when'); | |
var suite = new Benchmark.Suite; | |
// add tests | |
suite |
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
/*jslint node: true */ | |
/*jslint esnext: true*/ | |
"use strict"; | |
let AppDispatcher = require('../dispatcher/AppDispatcher'); | |
let ApiClient = require('../api-client/api-client'); | |
let URITemplate = require('URIjs/src/URITemplate'); | |
let RouteTemplates = require('../constants/constants').ROUTE_TEMPLATES; | |
let _ = require('lodash'); | |
let DeepGet = require('../utils/DeepGet'); |
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
//Fetch data from the API using dot notation. | |
//Only used when the dot notation will result in a valid URI | |
ApiClient.fetchData("parent_employers.2.work_sites") | |
.done((data) => { | |
console.log(data); | |
}); | |
//More advanced chaining | |
//Fetch data from the api using chained functions | |
ApiClient.parent_employers({id: 2}) //params replace templated uris |
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
var React = require('react'); | |
var TypeaheadStore = require('../stores/TypeaheadStore'); | |
var TypeaheadActions = require('../actions/TypeaheadActions'); | |
var _ = require('lodash'); | |
var TypeaheadItem = React.createClass({ | |
render() { | |
return ( | |
<div>{this.props.name}</div> | |
) |