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
function is_valid_ts(x,y) { | |
return "dont think so" | |
} | |
function isValidTs(x: string[], y: string): boolean { | |
return x.length > 0 && x[0] === y && x[x.length - 1] === y; | |
} |
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 dataclasses import dataclass, field | |
from typing import List, Optional | |
@dataclass(order=True) | |
class File: | |
sort_index: int = field(init=False, repr=False) | |
name: str | |
size: int = 0 | |
is_folder: bool = False |
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 com.example.additionalproperties; | |
import java.lang.reflect.Field; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class AdditionalPropertiesExtractor { | |
public static Map<String, String> extractAdditionalProperties(Object obj) { |
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 dataclasses import dataclass | |
import os | |
import time | |
from pymongo import MongoClient | |
import sqlite3 | |
@dataclass | |
class FieldMeta: |
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
{ | |
"keys": { | |
1: "Make", | |
2: "Model", | |
3: "Year", | |
4: "Color", | |
5: "Mileage", | |
6: "Price", | |
7: "Engine", | |
8: "Fuel Type" |
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 json | |
import boto3 | |
NOT_FOUND = 'NOT_FOUND' | |
def get_permissions_for_endpoint_identity(endpoint_identity: str) -> set[str]: | |
try: | |
client = boto3.client('dynamodb') | |
response = client.get_item(TableName='2a_permission_table', |
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 datadog_api_client import ApiClient, Configuration | |
from datadog_api_client.v2.api.logs_api import LogsApi | |
from datadog_api_client.v2.model.content_encoding import ContentEncoding | |
from datadog_api_client.v2.model.http_log import HTTPLog | |
from datadog_api_client.v2.model.http_log_item import HTTPLogItem | |
from datadog_api_client.model_utils import unset | |
from datadog_api_client.v2.api.metrics_api import MetricsApi | |
from datadog_api_client.v2.model.metric_payload import MetricPayload | |
class DataDogClient: |
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
# A simple token-based authorizer example to demonstrate how to use an authorization token | |
# to allow or deny a request. In this example, the caller named 'user' is allowed to invoke | |
# a request if the client-supplied token value is 'allow'. The caller is not allowed to invoke | |
# the request if the token value is 'deny'. If the token value is 'unauthorized' or an empty | |
# string, the authorizer function returns an HTTP 401 status code. For any other token value, | |
# the authorizer returns an HTTP 500 status code. | |
# Note that token values are case-sensitive. | |
import json | |
import boto3 |
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
func CreateListOfIPsForIPPool(excludedIPs []string, deviceIPv4Range string) ([]string, error) { | |
_, cidr, err := net.ParseCIDR(deviceIPv4Range) | |
if err != nil { | |
return nil, fmt.Errorf("failed parsing cidr of device [%s]: %w", deviceIPv4Range, err) | |
} | |
// Sort excludedIPs once for efficient binary search | |
sort.Strings(excludedIPs) | |
var ipPoolAddresses []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 { Context } from 'aws-lambda'; | |
// Define the UserID interface | |
interface UserID { | |
id: string; | |
} | |
// Define the UserDetails interface | |
interface UserDetails { | |
userId: string; |
NewerOlder