View twitter_controller.rb
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 'oauth/consumer' | |
require 'json' | |
class TwitterController < ApplicationController | |
before_filter :require_no_authentication | |
TWITTER_AUTH_KEY = '...' | |
TWITTER_AUTH_SECRET = '...' | |
TWITTER_AUTH_URL = 'http://twitter.com' | |
View gist:59cef760acb2adfd1e8fea017e779a30
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
Stream URL: rtmp://rtmp-api.facebook.com:80/rtmp/389171898089182?ds=1&s_l=1&a=ATipJJZm6SMHA-jU | |
Server URL: rtmp://rtmp-api.facebook.com:80/rtmp/ | |
Stream Key: 389171898089182?ds=1&s_l=1&a=ATipJJZm6SMHA-jU |
View movie-favorites-event-2.js
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 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 = event.target; |
View movie-favorites-event-1.js
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
// 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("http://omdbapi.com/?i=tt0103639", displayResults); | |
} |
View movie-favorites-ajax.js
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
$.get("http://omdbapi.com/?i=tt0103639", displayResults); | |
function displayResults(results) { | |
console.log(results.Title); | |
console.log(results.Year); | |
console.log(results.Rated); | |
console.log(results.Runtime); | |
console.log(results.Plot); | |
} |
View movie-favorites-jquery.html
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
<head> | |
<meta charset="utf-8"> | |
<title>Movie Favorites</title> | |
<link rel="stylesheet" href="styles.css" media="screen"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
</head> |
View avand.json
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
{ | |
"name": "Avand Amiri", | |
"bio": "Hi there, my name is Avand!", | |
"image": "http://avandamiri.com/images/avand.jpg" | |
} |
View split.js
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
// 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] | |
} |
View todo-list-item.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
input:checked + span { | |
opacity: 0.2; | |
text-decoration: line-through; | |
} |
View arrays.js
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 arr = []; | |
arr.push("a"); | |
arr.push("b"); | |
arr.push("c"); | |
arr[0]; // => "a" | |
arr[1]; // => "b" | |
arr[2]; // => "c" | |
arr[3]; // => undefined |
NewerOlder