Skip to content

Instantly share code, notes, and snippets.

from datetime import date
from google.oauth2 import service_account
from googleapiclient.discovery import build
import pandas as pd
import numpy as np
credentials = service_account.Credentials.from_service_account_file(
"./credentials.json"
)
import requests
import math
import json
import pandas as pd
# IronMan WC 2019 id
eventId = 'AFAAC1DC-73BA-E811-A967-000D3A37468C'
limitPerPage = 100
import { cloneElement, Component } from 'react';
import PropTypes from 'prop-types';
class Draggable extends Component {
state = {
dragging: false,
pos: this.props.pos,
rel: null,
}
import React from 'react';
import { renderToString } from 'react-dom/server';
import { axe, toHaveNoViolations } from 'jest-axe';
import Component from '/path';
expect.extend(toHaveNoViolations);
it('should have no a11y violations', async () => {
const wrapper = renderToString(<Component />);
const results = await axe(wrapper);
<!-- Inaccessible form -->
<form>
<label>email: </label>
<input type="email">
</form>
<!-- Accessible form -->
<form>
<label for="email">email: </label>
<input type="email" name="email" id="email">
function factorial(n) {
if (!n) return 1;
return n * factorial(n-1);
}
function factorialTCO(n, partialFactorial = 1) {
if (!n)
return partialFactorial;
return factorialTCO(n - 1, n * partialFactorial);
}
// Taken from Douglas Crockford's JavaScript: The Good Parts
function walkDOM(node, func) {
func(node);
node = node.firstChild;
while(node) {
walkDOM(node, func);
node = node.nextSibling;
}
}
function recursiveFibonacci(n) {
if (n <= 1) {
return n;
}
else {
return recursiveFibonacci(n-1) + recursiveFibonacci(n-2);
}
}
function iterativeFibonacci(n) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML & CSS Codelab para Mulheres</title>
</head>
<body>
<h1>Este é um cabeçalho 1</h1>
<h2>Este é um cabeçalho 2</h2>
<h3>Este é um cabeçalho 3</h3>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML & CSS Codelab para Mulheres</title>
</head>
<body>
<p>
There was a war. A Time War. The Last Great Time War. My people fought a race called the Daleks, for the sake of all
creation. And they lost. We lost. Everyone lost. They're all gone now. My family. My friends. Even that sky.