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 hungrylMachine = Machine({ | |
id: "hungry", | |
initial: "fridge", | |
states: { | |
fridge: { | |
on: { | |
cook: "cook", | |
order: "order", | |
go_to_moms_house: "moms" | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<title>Linkify Comment Urls</title> | |
<style> | |
body { | |
background-color: #F1F1F1; | |
font-family: Helvetica; | |
} |
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
// These two need to be declared outside the try/catch | |
// so that they can be closed in the finally block. | |
HttpURLConnection urlConnection = null; | |
BufferedReader reader = null; | |
// Will contain the raw JSON response as a string. | |
String forecastJsonStr = null; | |
try { | |
// Construct the URL for the OpenWeatherMap query |
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
var calculator = function() { | |
var numbers = [4,2,5,7], | |
sum = 0 | |
var getSum = function() { | |
for(var x = 0; x < numbers.length; x++){ | |
sum += numbers[x]; | |
} | |
return sum; | |
}; | |
var sayHello = function() { |
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
shadow box | |
-moz-box-shadow: 3px 3px 5px 6px #ccc; | |
-webkit-box-shadow: 3px 3px 5px 6px #ccc; | |
box-shadow: 3px 3px 5px 6px #ccc; |
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
<style> | |
ul {padding:0;} | |
ul li { | |
background-repeat: no-repeat; | |
background-position: top left; | |
background-image: url('http://hosturl.co.uk/cc/d.png'); | |
line-height: 57px; | |
padding-left: 70px; | |
margin: 0px; | |
list-style: none; |
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
print "What celsius tempurature would you like convert to farhenheith?" | |
celsius = gets.chomp.to_i | |
fahrenheit = (celsius *9/5 + 32) | |
puts "The result is: #{fahrenheit}" |
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
<style> | |
p { | |
border-style: dashed; | |
border-width: 1px; | |
border-color: orange; | |
margin: 0px; | |
padding-left: 10%; | |
padding-right: 10%; | |
text-align: justify; |
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
// first we can make the instructor | |
function Rabbit(adjective) { | |
this.adjective = adjective; | |
this.describeMyself = function() { | |
console.log("I am a " + this.adjective + " rabbit"); | |
}; | |
} | |
// now we can easily make all of our rabbits | |
var rabbit1 = new Rabbit("fluffy"); |
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
// use taxiFare to set tripCost to the cost of your | |
// ride covering 5 miles at 2 am in the morning | |
var tripCost = taxiFare(5, 2); | |
// calculates taxi fare based upon miles traveled | |
// and the hour of the day in military time (0-23). | |
var taxiFare = function (milesTraveled, pickupTime) { | |
var baseFare = 2.50; | |
var costPerMile = 2.00; | |
var nightSurcharge = 0.50; // 8pm to 6am, every night |
NewerOlder