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 X = | |
{ | |
foo: function() | |
{ | |
var bar=function(){return 'Thunk!';}; | |
this.foo = bar; | |
return bar.call(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
#! /usr/bin/python | |
from logging import getLogger | |
from logging.config import dictConfig | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': |
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
Sub Backup(source as FolderItem, destination as FolderItem) | |
if source is nil then | |
dim e as new NilObjectException | |
e.Message = "Backup failed. source is nil." | |
raise e | |
end if | |
if destination is nil then | |
dim e as new NilObjectException | |
e.Message = "Backup failed. destination is nil." | |
raise e |
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
# The following example demonstrates a use of a Python assignment expression in the course of parsing a str into a tuple. | |
# The value kid contains a key type and a key lookup id, delimited by '-'. The goal is to split them apart and | |
# convert the key lookup id to int, with little regard for readability. | |
kid = 'pwid-43' | |
key_type, key_sn = ((x:=kid.split('-'))[0], int(x[1])) | |
# To limit the scope of the variable to the expression, one can wrap the expression into a lambda function. | |
key_type, key_sn = (lambda kid: ((x:=kid.split('-'))[0], int(x[1])))(kid) |
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 { setupWorker } from 'msw' | |
import { handlers } from './api/index' | |
// This configures a Service Worker with the given request handlers. | |
export const worker = setupWorker(...handlers) |