Skip to content

Instantly share code, notes, and snippets.

View andrewevans0102's full-sized avatar

Andrew Evans andrewevans0102

View GitHub Profile
this.gain.gain.value = 0;
this.oscillator.frequency.value = 750;
this.oscillator.connect(this.gain);
this.gain.connect(this.audioContext.destination);
this.audioContext = new AudioContext();
this.oscillator = this.audioContext.createOscillator();
this.gain = this.audioContext.createGain();
onSubmit() {
if (this.audioContext === undefined) {
// Chrome requires audio context after gesture
// https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio
this.createContext();
}
this.generateMorse(this.audioContext.currentTime, this.morseText);
}
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const request = require('request');
// when a new user is registered
exports.createUser = functions.firestore
.document('users/{userId}')
.onCreate((snap, context) => {
const newValue = snap.data();
// this will fire whenever a record is added to the users collection
exports.createUser = functions.firestore
.document('users/{userId}')
.onCreate((snap, context) => {
// Get an object representing the document
// e.g. {'name': 'Marie', 'age': 66}
const newValue = snap.data();
// access a particular field as you would any JS property
const name = newValue.name;
import java.util.*;
class Solution {
public int lengthOfLongestSubstring(String s) {
HashMap<Character, Integer> locations = new HashMap<Character, Integer>();
int max = 0;
char[] characterS = s.toCharArray();
for(int i = 0; i < characterS.length; i++) {
if(locations.containsKey(characterS[i])) {
for(int row = 0; row < parentsChild.length; row++) {
if(!parentsList.containsKey(parentsChild[row][1])) {
parentsList.put(parentsChild[row][1], 1);
} else {
parentsList.put(parentsChild[row][1], 2);
}
}
public static void main(String [] args) {
int[][] children = new int[][]{
{1, 3}, {3, 7}, {4,3}, {4, 5},
{8, 5}, {8, 2}, {5, 9}, {10, 2}
};
Map<String, List<Integer>> oneZero = findParents(children);
for(Map.Entry<String, List<Integer>> entry: oneZero.entrySet()) {
System.out.println(entry.getKey());
"scripts": {
"github-clone": "git clone https://github.com/angular/material2.git",
"github-delete": "rm -rf material2",
"install-dependencies": "pip install mkdocs && pip install mkdocs-material",
"build": "npm run github-delete && npm run github-clone && python site.py && cd generated-site && mkdocs serve",
"deploy": "cd generated-site && mkdocs build && mkdocs gh-deploy"
}
# Start
delete_files_and_folders()
create_files_and_folders()
select_md()
copy_md()