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
function getData(text){ | |
if(text.split(" ")[0] == "calc"){ | |
return text.split(" ")[1].split("_")[0] - text.split(" ")[1].split("_")[1]; | |
} | |
else{ | |
return false; | |
} | |
} | |
if(getData("calc 2_1")){ |
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
function getData(text){ | |
var commandAndArgs = text.split(" "); | |
var command = commandAndArgs[0]; | |
var args = commandAndArgs[1]; | |
var arrayOfArgs = args.split("_"); | |
var arg1 = arrayOfArgs[0]; | |
var arg2 = arrayOfArgs[1]; | |
if(command == "calc"){ | |
return arg1 - arg2; | |
} |
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
for(var i = 1; i < 30; i++){ | |
console.log(i % 15 == 0 ? "FizzBuzz" : i % 3 == 0 ? "Fizz" : i % 5 == 0 ? "Buzz" : i); | |
} |
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
for(var i = 1; i < 30; i++){ | |
if(i % 15 == 0){ | |
console.log("FizzBuzz"); | |
} | |
else if(i % 3 == 0){ | |
console.log("Fizz"); | |
} | |
else if(i % 5 == 0){ | |
console.log("Buzz"); | |
} |
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
for(var i = 1; i < 30; i++){ | |
console.log((i % 3 ? x = '' : 'Fizz')+(i % 5 ? x: 'Buzz') || x+i); | |
} |
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
/* | |
* Lazy Line Painter | |
* SVG Stroke animation. | |
* | |
* https://github.com/camoconnell/lazy-line-painter | |
* http://www.camoconnell.com | |
* | |
* Copyright © 2013-2015 Cam O'Connell | |
* All rights reserved. | |
* |
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
class Programmer{ | |
public function drinkCoffee(){ | |
System.out.print("I'm drinking...."); | |
} | |
} | |
class BackEndProgrammer extends Programmer{ | |
public function createBackEnd(){ | |
System.out.print("I'm creating back-end...."); | |
} |
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
class AI{ | |
public function powerUp(){ | |
System.out.print("Fired up and ready to serve"); | |
} | |
} | |
class CleaningAI extends AI{ | |
public function clean(){ | |
System.out.print("Cleaning the code..."); | |
} |
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
class FrontEndAndCleaningAI extends CleaningAI{ // now this AI can clean code | |
public function createFrontEnd(){ | |
System.out.print("I'm creating front-end...."); | |
} | |
} |
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
const puppeteer = require('puppeteer'); | |
(async () => { | |
// launch the browser | |
const browser = await puppeteer.launch({ | |
headless: true // headless or non-headless | |
}); | |
// open a new tab | |
const page = await browser.newPage(); |
OlderNewer