Loads all TypeScript, JavaScript and JSON files from locales directory, if i18next backend is not configured. .ts
files shadow .js
files, .js
files shadow .json
files. The folder/file structure is resembled in the final locales object, while the filenames are camelcased, i.e. a folder main-state
will be a key mainState
, which will contain all content from that folder. If LocalesLoader finds an ES6 default export or an export the same name as the camelcased file name, only this is taken from the file. In any other case, everything is exported. Files and folders of the same name are merged. An example can be found here.
This file contains 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
! | |
! Title: Tapo Firmware Upgrade DNS Blocking List | |
! | |
# [tplinkcloud.com] | |
127.0.0.1 n-device-api.tplinkcloud.com | |
# [tplinknbu.com] | |
127.0.0.1 security.iot.i.tplinknbu.com |
This file contains 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
ShowHideWindow(winTitle, winExe := "") | |
{ | |
WinGet, targetWindowID, IDLast, %winTitle% | |
if ("%winExe%" != "") and (not WinExist(winTitle)) { |
This file contains 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 Requester { | |
/** Intermediate observable used to prepare fetching connector identifiers and updating `connectorIdentifiers$`. */ | |
protected readonly fetchConnectorIdentifiers$ = new Subject<number>(); | |
constructor() { | |
/** | |
* When idle and an identifiers fetch request comes in, this waits 100ms before triggering. | |
* When just received a value (within the 100ms window), these do not increase the window timeout. | |
*/ | |
const fetchConnectorIdentifiersTimer$ = this.fetchConnectorIdentifiers$.pipe(mapTo(undefined), auditTime(100)); |
This file contains 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
<ng-container *ngIf="listEntities$ | async as listEntities"> | |
<div class="label-context-panel" *ngIf="listEntities.length > 0"> | |
<ul> | |
<ng-container *ngFor="let entity of listEntities"> | |
<ng-container [ngSwitch]="entity.type"> | |
<li *ngSwitchCase="'content'" [ngClass]="{ property: true, enabled: !entity.disabled }" (click)="selectReturnValue(entity)">{{ entity.propertyType }} <span class="name">{{ entity.propertyName }}</span> | |
<div [ngClass]="'tooltip'"> | |
<div class="errorHeading" *ngIf="entity.tooltip.errorHeading">{{ entity.tooltip.errorHeading }}</div> | |
{{ entity.tooltip.message }} | |
</div> |
This file contains 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
#compdef _lerna lerna | |
#http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System | |
function _lerna { | |
local line | |
_arguments -C \ | |
"--version" \ | |
"--loglevel[Set the log output level]:level:(silent info warn error)" \ | |
"--concurrency[How many processes to use when lerna parallelizes tasks]" \ |
This file contains 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
http.createServer(function(r, s) { | |
var body = []; | |
r.on("data", function(chunk) { | |
body.push(chunk) | |
}); | |
r.on("end", function() { | |
body = Buffer.concat(body).toString(); | |
body = r.headers["content-type"] === "application/json" ? JSON.parse(body) : body; | |
console.log(r.method, r.url, r.headers, JSON.stringify(body, null, 2)); | |
s.write("OK"); |
This file contains 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
# Git hook to prevent focused tests/specs (fdescribe, fit) | |
red='\033[0;31m' | |
no_color='\033[0m' | |
focused_spec_findings=$(git grep --cached -nIE "^\s*f(describe|it)\b") | |
if [ ! -z "$focused_spec_findings" ] | |
then | |
# Redirect output to stderr. | |
exec 1>&2 | |
echo ${red}You still got some focused tests \(fdescribe, fit, etc.\), please clean these before committing:${no_color} |
This file contains 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
"preinstall": "rm -rf assistantjs && git clone --depth=1 [email protected]:webcomputing/assistantjs --branch feature/autobind-except --single-branch && cd assistantjs && npm i && cd ./node_modules/gulp/bin && node gulp.js build-sources-and-maps build-dts && cd ../../../..", |
This file contains 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
/** | |
* THIS IS IMPORTANT!!! | |
* | |
* If it's typed like `new (...args: any[]) => any` these examples won't work! | |
*/ | |
type Ctor = new (...args: any[]) => {}; |
NewerOlder