Skip to content

Instantly share code, notes, and snippets.

View avand's full-sized avatar

Avand Amiri avand

View GitHub Profile
Stream URL: rtmp://
Server URL: rtmp://
Stream Key: 389171898089182?ds=1&s_l=1&a=ATipJJZm6SMHA-jU
var aladdin = document.querySelector(".aladdin");
var terminator = document.querySelector(".terminator");
aladdin.addEventListener("click", getMovie);
terminator.addEventListener("click", getMovie);
// ...and so on for each movie
// One event handler to rule them all...
function getMovie(event) {
var clickedMovie =;
// Assuming there's an <img class="aladdin"> on the page...
var aladdin = document.querySelector(".aladdin");
aladdin.addEventListener("click", getAladdin);
// You'll have multiple event handlers...
function getAladdin(event) {
$.get("", displayResults);
$.get("", displayResults);
function displayResults(results) {
<meta charset="utf-8">
<title>Movie Favorites</title>
<link rel="stylesheet" href="styles.css" media="screen">
<script src=""></script>
"name": "Avand Amiri",
"bio": "Hi there, my name is Avand!",
"image": ""
avand / split.js
Created September 30, 2016 16:11
// This is a string... (looks like a list but still a string)
var animalsString = "cow,dog,horse,moose,rooster";
// Turn the string into an array...
var animalsArray = animalsString.split(",");
// Now you can go about looping, like normal...
for (var i = 0; i < animalsArray.length; i++) {
// animalsArray[i]
input:checked + span {
opacity: 0.2;
text-decoration: line-through;
document.querySelector("form").addEventListener("submit", search);
function search(event) {
var query = document.querySelector("#query").value;
var url = "" + query;
// Check local storage to see if the results have already been
// retrieved with the URL as the key...
// This would be so much easier to read and write...
var position = navigator.geolocation.getCurrentPosition();
// So why in the world do we have to write this?
navigator.geolocation.getCurrentPosition(function(position) {