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’).on(‘keypress’, (event)=> { | |
if(event.which === 13){ | |
//Do Something | |
} | |
}); |
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
<form> | |
<input type=”text”> | |
<button type=”submit”> | |
Search! | |
</button> | |
</form> |
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
$(‘form’).on(‘submit’, (event)=>{ | |
event.preventDefault(); | |
// Do what you want here | |
// In this case get input value | |
// Do a search | |
// Redirect to results page | |
}); |
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
#!/bin/bash | |
cd $HOME/Documents/Record_screen | |
echo "Recording. To stop and save it press CTRL+C" | |
xcrun simctl io booted recordVideo out.mov | |
ffmpeg -i out.mov -vf scale=320:-1 -r 10 "record_"$(date '+%W_%Y_%X').gif | |
rm out.mov | |
open $HOME/Documents/Record_screen | |
cd - |
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
describe('province', function() { | |
const asia = new Province(sampleProvinceData()); // DON'T DO THIS! | |
it('shortfall', function() { | |
expect(asia.shortfall).equal(5); | |
}); | |
it('profit', function() { | |
expect(asia.profit).equal(230); | |
}); | |
}); |
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
describe('province', function() { | |
it('shortfall', function() { | |
const asia = new Province(sampleProvinceData()); | |
expect(asia.shortfall).equal(5); | |
}); | |
it('profit', function() { | |
const asia = new Province(sampleProvinceData()); | |
expect(asia.profit).equal(230); | |
}); |
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
describe('province', function() { | |
let asia; | |
beforeEach(function() { | |
asia = new Province(sampleProvinceData()); | |
}); | |
it('shortfall', function() { | |
expect(asia.shortfall).equal(5); | |
}); | |
it('profit', function() { |
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
// *SMELL* | |
function convertTemperatures(farenheit, celcius, kelvin) { | |
const farenheitToCelcius = (5 / 9) * (farenheit - 32); | |
const farenheitToKelvin = ((farenheit - 32) / 1.8) + 273.15; | |
const celciusToFarenheit = (celcius * 1.8) + 32; | |
const celciusToKelvin = celcius + 273.15; | |
const kelvinToFarenheit = kelvin * 1.8 - 459.67; | |
const kelvinToCelcius = kelvin - 273.15; |
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
// *SMELL* | |
function ballSports() { | |
const playersTypes = [ | |
{name: "soccerPlayers", usesFeet: true, usesHands: false}, | |
{name: "basketPlayers", usesFeet: false, usesHands: true}, | |
{name: "volleyPlayers", usesFeet: false, usesHands: true}, | |
{name: "hockeyPlayers", usesFeet: false, usesHands: false} | |
// WHAT IF WE NEED TO ADD {name: "baseballPlayers", usesFeet: false, usesHands: false} ? | |
]; |
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
// *SMELL* | |
function mutableData() { | |
let name = { | |
firstName: "Rafael", | |
lastName: "Melo" | |
}; | |
name = `${name.firstName} ${name.lastName}`; | |
return name; | |
} |
OlderNewer