First, let's try just iterating through the list as we delete:
Here we're trying to remove all the numbers in our list under 3.
mylist = [1, 2, 3, 4, 5]
for item in mylist:
if item < 3:
mylist.remove(item)
class PollingBase { | |
poll = async ({ fn, validate, interval, maxAttempts = 10 }) => { | |
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) | |
for (let attempts = 0; attempts < maxAttempts; attempts++) { | |
try { | |
const result = await fn() | |
if (validate(result)) { | |
return result |
import React from 'react' | |
import useCustomScrollbars, { scrollbarWidth } from './useCustomScrollbars' | |
const Container = React.forwardRef(({ bg, children, ...props }, ref) => { | |
const [localRef, scrollbarsShown, scrollbarStyles] = useCustomScrollbars( | |
children, | |
ref, | |
bg | |
) |
First, let's try just iterating through the list as we delete:
Here we're trying to remove all the numbers in our list under 3.
mylist = [1, 2, 3, 4, 5]
for item in mylist:
if item < 3:
mylist.remove(item)
version: 2 | |
jobs: | |
build: | |
working_directory: ~/repo | |
docker: | |
- image: circleci/node:10 | |
steps: | |
- checkout | |
- run: |
#!/usr/bin/env python3 | |
import sys | |
import json | |
import requests | |
slack_url = "https://hooks.slack.com/services/<webhook URL>" | |
def get_subject(lines): | |
try: |
<i class="icon-star"></i> |
I hereby claim:
To claim this, I am signing this object: