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
from requests_html import AsyncHTMLSession | |
session = AsyncHTMLSession() | |
async def get_cnn(): | |
r = await session.get('https://edition.cnn.com/') | |
title = r.html.find('title')[0].text | |
print(title) |
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
license: gpl-3.0 | |
height: 620 | |
border: no |
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
function histogramChart(color_value, title, xAxisTitle, yAxisTitle, num_of_of_bins) { | |
var margin = {top: 30, right: 40, bottom: 50, left: 50}, | |
width = 460, | |
height = 300; | |
var histogram = d3.layout.histogram(), | |
x = d3.scale.ordinal(), | |
y = d3.scale.linear(), | |
xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(6, 0), | |
yAxis = d3.svg.axis() |
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
function hello(person: string) { | |
return "Hello, " + person; | |
} | |
console.log(hello("Radddph")); |
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
function observable(cb) { | |
function* _() { | |
let state = { | |
title : "State management", | |
random: 0, | |
counter : 0 | |
} | |
while (true) { | |
let newvalue = yield state; | |
state = {...state, ...newvalue} ; |
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
TEST |
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
[ | |
{ | |
"titre" : "Simple Counter", | |
"url" : "https://github.com/artydev/mvu/raw/main/examples/simple-counter.html" | |
}, | |
{ | |
"titre" : "Multiple Counters", | |
"url" : "https://github.com/artydev/mvu/raw/main/examples/multiple_counters.html" | |
}, | |
{ |
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
//<script src="https://cdn.jsdelivr.net/gh/artydev/mvu@2.0/dist/mvu.umd.js"></script> | |
//<div id="app></app> | |
const { dom, udom, m, render } = MVU; | |
let h1 = m("h1") | |
let button = m("button") | |
let div = m("div") | |
let span = m("span") | |
let nl = m("br") |
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 { m } = MVU; | |
let list = m("ul"); | |
let div = m("div"); | |
let li = m("li"); | |
let styleList = ` | |
height: 652px; | |
overflow:auto; | |
` |
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 flipCoin = () => Math.random() < 0.5; | |
async function sendRequestToServer() { | |
return new Promise(((resolve, reject) => { | |
setTimeout(()=> { | |
if (flipCoin()) { | |
alert("Oops. An error occurred"); | |
return; | |
} |