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 https = require("https"); | |
| const urlList = [ | |
| "https://reqres.in/api/users?page=1", | |
| "https://reqres.in/api/users?page=2", | |
| "https://reqres.in/api/users?page=3" | |
| ]; | |
| function getSiteContents(url) { | |
| return new Promise(function (resolve, reject) { |
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
| <?php | |
| // Accumulator gets passed around for reuse - function as a value | |
| $accumulator = function ( | |
| string $accumulated_string, | |
| string $mapped_list_element | |
| ) { | |
| return $accumulated_string . $mapped_list_element . "\n"; | |
| }; |
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
| <?php | |
| $accumulator = function ( | |
| string $accumulated_string, | |
| string $mapped_list_element | |
| ) { | |
| return $accumulated_string . $mapped_list_element . "\n"; | |
| }; | |
| $mapped_array = array_reduce( |
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
| module Main where | |
| import Control.Monad.IO.Class (liftIO) | |
| import Control.Monad.Trans.Resource (runResourceT) | |
| import Data.Conduit (($$+-), ($=+), runConduit) | |
| import Data.Conduit.List (mapM_, map, filter, catMaybes) | |
| import Data.Text (unpack) | |
| import Data.Maybe (fromJust) | |
| import Web.Twitter.Types | |
| (StreamingAPI(SStatus, SRetweetedStatus) |
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 Foundation | |
| import Dispatch | |
| func getRequestTask(url: String, dispatchGroup: DispatchGroup) { | |
| dispatchGroup.enter() | |
| let request = URLRequest(url: URL(string: url)!) | |
| let task = URLSession(configuration: URLSessionConfiguration.default).dataTask( | |
| with: request, |
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 concurrent.futures import ThreadPoolExecutor | |
| from http.client import HTTPException | |
| from urllib import request | |
| from typing import Union, Dict, Any, List | |
| def get_request_task(url: str) -> Union[List[Dict[str, Any]], None]: | |
| try: | |
| contents = None | |
| with request.urlopen(url) as response: |
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 Person { | |
| let name: String | |
| init(name: String) { self.name = name } | |
| var apartment: Apartment? | |
| deinit { print("\(name) is being deinitialized") } | |
| } | |
| class Apartment { | |
| let unit: String | |
| init(unit: String) { self.unit = unit } |
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 gc | |
| import ctypes | |
| gc.set_debug(gc.DEBUG_SAVEALL) | |
| class PyObject(ctypes.Structure): | |
| _fields_ = [("refcnt", ctypes.c_long)] | |
| object1 = {} | |
| object2 = {} |
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
| // Your React Component | |
| class VisaCheckboxComponent extends React.Component { | |
| // Deal with your constructor as you please | |
| // Other methods of your component | |
| onClick() { | |
| this.props.onClick(); | |
| // Other stuff that onClick should do like setState |
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
| MAKEFLAGS += --warn-undefined-variables | |
| .SHELLFLAGS := -o pipefail -euc | |
| BUILD_DIRECTORY := $(shell pwd)/ | |
| GOPATH := $(BUILD_DIRECTORY)vendor/ | |
| GOBIN := $(BUILD_DIRECTORY)bin/ | |
| install: | |
| @echo "---> Installing Promtool" |