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 eventUtility = { | |
addEvent : function(el, type, fn) { | |
if (typeof addEventListener !== "undefined") { | |
el.addEventListener(type, fn, false); | |
} else if (typeof attachEvent !== "undefined") { | |
el.attachEvent("on" + type, fn); | |
} else { | |
el["on" + type] = fn; | |
} | |
}, |
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
<?php | |
// Prevent content sniffing attacks such as http://mths.be/bst. | |
header('X-Content-Type-Options: nosniff'); | |
// Note: The user-provided callback name must be filtered to prevent attack | |
// vectors. This script simply removes any symbols other than `[a-zA-Z0-9$_]` | |
// from the input. Sadly, this blocks the use of some valid JavaScript | |
// identifiers, and also accepts a few invalid ones. See | |
// http://mathiasbynens.be/notes/javascript-identifiers for details. |
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
$("#selectBox").append('<option value="option6">option6</option>'); |
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
//events - a super-basic Javascript (publish subscribe) pattern | |
var events = { | |
events: {}, | |
on: function (eventName, fn) { | |
this.events[eventName] = this.events[eventName] || []; | |
this.events[eventName].push(fn); | |
}, | |
off: function(eventName, fn) { | |
if (this.events[eventName]) { |
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
const axios = require("axios"); | |
const key = "AIzaSyB9e-dHIvdxxrbmorjYHWipwBKq7LJBhNk" | |
function getComments(pageToken, allItems = {}) { | |
const params = { | |
key, | |
videoId: "a4haLJdDRmc", | |
part: "snippet", | |
maxResults: 100, | |
pageToken, |