Skip to content

Instantly share code, notes, and snippets.

@Philocoder93
Philocoder93 / break.py
Created April 10, 2017 12:44 — forked from obfusk/break.py
python equivalent of ruby's binding.pry
import code; code.interact(local=dict(globals(), **locals()))
var john = {
'firstName':'john',
'lastName':'doe',
'phone':'(512) 355-0453',
'email':'johndoe@email'
};
var jane = {
'firstName':'jane',
'lastName':'doe',
'phone':'(312) 641-2203',
var convertToOunces = function() {
for (i=0;i<cups.length;i++) {
ounces[i] = cups[i] * 8;
}
};
var scores = [83,40,55,72,59,88,99];
var passOrFail = function() {
for (i=0;i<scores.length;i++) {
if (scores[i]>=60) {
scores[i] = "pass";
var contacts = ["Matt Smith", "Sam Davis", "Ashley Jones"];
var findContact = function(index) {
var get = contacts[index];
return get;
};
var addContact = function(name) {
contacts.push(name);
};
var updateLastContact = function(newName) {
var long = contacts.length;
// this code is my attempt at answer to question 1, I am not sure why it is not working
var apple = document.getElementsByClassName('current');
for ( i=0; i<apple.length; i++) {
document.getElementsByClassName('current').className = 'finished';
}
document.getElementById('next').className = 'current';
document.getElementById('next').removeAttribute('id');
document.getElementsByTagName('li')[3].setAttribute('id', 'next');
var addCool = function() {
document.querySelectorAll('.current')[1].textContent = 'Me Talk Pretty One Day.'
document.getElementById('next').innerHTML = '<a href="http://www.amazon.com/Flamethrowers-Rachel-Kushner/dp/1439142017/ref=sr_1_1?ie=UTF8&qid=1458897183&sr=8-1&keywords=the+flamethrowers">The Flamethrowers</a>';
document.querySelector('li').innerHTML = 'The Wind Up <strong>Bird</strong> Chronicle.';
document.querySelectorAll('li')[3].textContent = "I'm the fourth!"
var listLi = document.getElementsByTagName('li');
for (i=0;i<listLi.length;i++) {
document.getElementsByTagName('li')[i].textContent = 'JavaScript rules!'
}
document.getElementsByClassName('current')[0].innerHTML = 'Manipulating the DOM is fun!';
var fizzBuzz = function(a) {
for (i = 1; i <= a; i++) {
if (fizz(i)&&buzz(i)) {
console.log("fizzBuzz");
}
else if (fizz(i)) {
console.log("fizz");
}
else if (buzz(i)) {
console.log("buzz");
//write your answer below
var sayHello = function(name) {
return "Hello" + name;
};
var areBothEven = function(a,b) {
if ((a%2 === 0)$$(b%2 ===s 0)) {
return true;
}
body{
font-size: 18px;
font-family: 'Open Sans', sans-serif;
}
h1{
font-size: 2em;
}
h2{
body{
font-size: 18px;
font-family: "Open sans", "sans serif"d;
}
h1{
font-size: 2em;
font-weight: 800px;
}