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 { createAsyncThunk } from '@reduxjs/toolkit'; | |
| import type { AppDispatch, RootState } from './my-store-file'; | |
| import { useAppDispatch } from './my-store-file'; | |
| import { useCallback } from 'react'; | |
| import { useOfflineExecutor } from './offline-executor'; | |
| import { createItem } from './create-item-slice.ts'; | |
| import { ItemService } from './services'; | |
| export type CreateItemThunkArg = { |
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 concurrent.futures | |
| from time import sleep | |
| def expensive_computation(number): | |
| sleep(10) | |
| return number | |
| class Runnable: | |
| def __init__(self, original_target, *args, **kwargs): | |
| self.original_target = original_target |
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
| {{>header}} | |
| {{>part_of}} | |
| class ApiClient { | |
| ApiClient({this.basePath = '{{{basePath}}}'}) { | |
| {{#hasAuthMethods}} | |
| // Setup authentications (key: authentication name, value: authentication). | |
| {{#authMethods}} | |
| {{#isBasic}} | |
| {{#isBasicBasic}} | |
| _authentications[r'{{{name}}}'] = HttpBasicAuth(); |
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
| { | |
| "openapi": "3.0.0", | |
| "info": { | |
| "title": "Foo", | |
| "description": "Foo", | |
| "version": "1.0", | |
| "contact": {} | |
| }, | |
| "tags": [], | |
| "servers": [], |
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 { useRef, useCallback } from 'react'; | |
| /** | |
| * Creates a stable callback pointing to the **latest | |
| * render** [callback] provided to this function, making it stable | |
| * without specifying deps. | |
| * | |
| * Note: Don't use this for render callbacks, this will cause | |
| * renders to not update properly when state changes. | |
| */ |
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
| package_name("com.foo.bar") |
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
| class Foo { | |
| dynamic getA(){ | |
| return null; | |
| } | |
| } | |
| extension IsNull on dynamic { | |
| bool get isNull => this == null; | |
| } |
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
| extension Nulls on dynamic { | |
| bool get isNull => this == null; | |
| } | |
| class Foo { | |
| String getA(){ | |
| return null; | |
| } | |
| } |
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
| void main() { | |
| var list = ['Jonny', 'Gabriel']; | |
| Iterable list2 = Set<String>(); | |
| list = list2; | |
| list.sort(); | |
| } |
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
| void main() async { | |
| final list = [1,6,3,2,4,5]; | |
| print('Sequential'); | |
| for(final time in list) { | |
| await Future.delayed(Duration(seconds: time)); | |
| print(time); | |
| } | |
| print('Not sequential'); |