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
| import asyncio | |
| import aiohttp | |
| import time | |
| async def gather_with_concurrency(n, *tasks): | |
| semaphore = asyncio.Semaphore(n) | |
| async def sem_task(task): | |
| async with semaphore: |
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
| {"version":1,"resource":"file:///Users/alta/Projects/WeatherBee/babel.config.js","entries":[{"id":"NtZk.js","timestamp":1649748629169},{"id":"C0fN.js","timestamp":1649748969744}]} |
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
| { | |
| "extends": ["react-app", "plugin:prettier/recommended"] | |
| } |
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
| # This is something that I always forget and had a surprisingly hard time finding (or better yet, understanding). Here's the | |
| # scenario: a colleague creates a new kubernetes cluster, named" cluster-foo.example.com". You want to look at it (for | |
| # troubleshooting, updating the deployment, whatever). To get your kubectl installation to "see" the new cluster, take the | |
| # following steps: | |
| # ASSUMPTION: You have pointed kops to some location where the cluster configurations are stored | |
| # (I have this in my ~/.bash_profile): | |
| export KOPS_STATE_STORE=s3://example-state-store | |
| # Use kops to get the list of clusters |
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
| // This is a super simplified example of how to use the new dagger.android framework | |
| // introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android | |
| // read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd | |
| // For a complete codebase using dagger.android 2.11-2.17, butterknife 8.7-8.8, and MVP, | |
| // see https://github.com/vestrel00/android-dagger-butterknife-mvp | |
| // This example works with Dagger 2.11-2.17. Starting with Dagger 2.11, | |
| // @ContributesAndroidInjector was introduced removing the need to define @Subcomponent classes. |
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
| /* eslint-disable prefer-template */ | |
| const path = require('path'); | |
| const aliases = require('./aliases'); | |
| // /////////////////////////////////////////////////////////////// | |
| // ////////////////// PLUGINS //////////////////////////////// | |
| // /////////////////////////////////////////////////////////////// | |
| const commonPlugins = [ |
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
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
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
| import boto3 | |
| from termcolor import colored | |
| ec2 = boto3.resource('ec2') | |
| for i in ec2.instances.all(): | |
| print("Id: {0}\tState: {1}\tLaunched: {2}\tRoot Device Name: {3}".format( | |
| colored(i.id, 'cyan'), | |
| colored(i.state['Name'], 'green'), |
NewerOlder