"tools": [
{
"functionDeclarations": [
{
"name": "browser_subagent",
"description": "Start a browser subagent to perform actions in the browser with the given task description. The subagent has access to tools for both interacting with web page content (clicking, typing, navigating, etc) and controlling the browser window itself (resizing, etc). Please make sure to define a clear condition to return on. After the subagent returns, you should read the DOM or capture a screenshot to see what it did. Note: All browser interactions are automatically recorded and saved as WebP videos to the artifacts directory. This is the ONLY way you can record a browser session video/animation. IMPORTANT: if the subagent returns that the open_browser_url tool failed, there is a browser issue that is out of your control. You MUST ask the user how to proceed and use the suggested_responses tool.",- Use the spread operator with type inference:
export function cache<T extends (...args: any[]) => any, KeyType, ResultType, ErrorType>(
fn: T,
options: Partial<ICacheOptions<KeyType, ResultType, ErrorType>> = {}
): T {
const mergedOptions: ICacheOptions<KeyType, ResultType, ErrorType> = {
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
| // | |
| // Études: Quirks and Implications of Numbers in JavaScript | |
| // | |
| // Reading: | |
| // - [Here is what you need to know about JavaScript’s Number type - Max Koretskyi](https://medium.com/angular-in-depth/javascripts-number-type-8d59199db1b6) | |
| // Quotes: | |
| // > Why 0.1+0.2 IS NOT equal to 0.3 and 9007199254740992 IS equal to 9007199254740993 | |
| // | |
| // > According to the ECMAScript standard, there is only one type for numbers and it is the ‘double-precision 64-bit | |
| // > binary format IEEE 754 value’. This type is used to store both integers and fractions and is the equivalent of `double` |
Coming from Python I wanted to write something like this:
@trace('name', opts)
def business_logic(foo, bar):
return 0To use opentelemetry in specific function and having goodies like putting relevant stuff in the context.
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
| trait Logger { | |
| protected def formatMessage(message: String): String | |
| def log(message: String): Unit = { | |
| println(formatMessage(message)) | |
| } | |
| // Nested case class inside the trait | |
| case class LogEntry(timestamp: Long, content: String) | |
| } |
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 timeit | |
| def test_performance(code, setup='pass', TIMES=10): | |
| avg = lambda l: sum(l)/len(l) | |
| result = timeit.Timer(code, setup).repeat(3,10) | |
| print avg(result) | |
| NESTED_FOR = """ | |
| for x in xrange(1000): | |
| for y in xrange(1000): |
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
| var usersStream = Bacon.interval(3000) | |
| .filter(function(){ return this.state.mode === "users" }.bind(this)) | |
| .flatMapLatest(function(){ | |
| var store = this.state.selectedStore; | |
| return Bacon.fromPromise( $.ajax({ | |
| type: 'GET', | |
| url: '/users/', | |
| data: {store_id: store.id} | |
| }) ); | |
| }.bind(this)) |
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
| # -*- coding: utf-8 -*- | |
| import cv2 | |
| import numpy as np | |
| feature_detectors = [ | |
| "FAST", | |
| "STAR", | |
| "SIFT", | |
| "SURF", | |
| "ORB", |
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
| POST http://rms-prep-sa.foodity.com/api/v2/recipes | |
| Request BODY BEGIN | |
| p_ingredients=tomato&fields=recipe_id%2Ctitle%2Cshort_title%2Cingredients%2Cmethods%2Cserves%2Ccook_time%2Cdifficulties%2Cassets%2Crelated_recipes&api_key=9HSRMDKDKXSSSLD4IOJJQHJMADRBWB&lang=en-GB&page_size=20 | |
| Request BODY END | |
| Response: | |
| { | |
| "page_start": 0, | |
| "data": [ | |
| { |
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
| POST http://rms-prep-sa.foodity.com/api/v2/recipes | |
| Request BODY BEGIN | |
| p_ingredients=tomato%2Conion&fields=recipe_id%2Ctitle%2Cshort_title%2Cingredients%2Cmethods%2Cserves%2Ccook_time%2Cdifficulties%2Cassets&api_key=9HSRMDKDKXSSSLD4IOJJQHJMADRBWB&lang=en-GB&page_size=20 | |
| Request BODY END | |
| Response: | |
| { | |
| "page_start": 0, | |
| "data": [ | |
| { |
NewerOlder