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
| this.gain.gain.value = 0; | |
| this.oscillator.frequency.value = 750; | |
| this.oscillator.connect(this.gain); | |
| this.gain.connect(this.audioContext.destination); |
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
| this.audioContext = new AudioContext(); | |
| this.oscillator = this.audioContext.createOscillator(); | |
| this.gain = this.audioContext.createGain(); |
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
| 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); | |
| } |
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 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 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
| // 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; |
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 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])) { |
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
| 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); | |
| } | |
| } |
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
| 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()); |
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
| "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" | |
| } |
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
| # Start | |
| delete_files_and_folders() | |
| create_files_and_folders() | |
| select_md() | |
| copy_md() |