Skip to content

Instantly share code, notes, and snippets.

View devversion's full-sized avatar

Paul Gschwendtner devversion

View GitHub Profile
@devversion
devversion / unifi_ap_standalone_wifi_toggle.sh
Last active June 16, 2024 08:57
Toggle Wifi of Unifi standalone AP using SSH
mode=$1 # enabled or disabled
sshpass -p <PW> ssh -o StrictHostKeyChecking=no admin@<ip> <<EOF
sed -i "s/wireless.status=.*/wireless.status=$mode/" /tmp/system.cfg
cfgmtd -f /tmp/system.cfg -w
reboot now
EOF
const babel = require('@babel/core');
const reproduce = true;
const res = babel.transformSync(
`
const variableNeeded = true;
class X {
diff --git a/src/material/core/common-behaviors/tabindex.ts b/src/material/core/common-behaviors/tabindex.ts
index b5788d46c..3be2d0193 100644
--- a/src/material/core/common-behaviors/tabindex.ts
+++ b/src/material/core/common-behaviors/tabindex.ts
@@ -23,10 +23,15 @@ export interface HasTabIndex {
/** @docs-private */
export type HasTabIndexCtor = Constructor<HasTabIndex>;
+// Needs JSDOC
+type LooseConstructor<T> = Function & { prototype: T };
@devversion
devversion / check_no_changes.ts
Created December 19, 2019 10:50
View Engine Change Detection vs. CheckNoChanges
markProjectedViewsForCheck(view);
Services.updateDirectives(view, CheckType.CheckNoChanges);
execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);
Services.updateRenderer(view, CheckType.CheckNoChanges);
execComponentViewsAction(view, ViewAction.CheckNoChanges);
// Note: We don't check queries for changes as we didn't do this in v2.x.
// TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.
view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);
@devversion
devversion / _mdc-form-field-standard-appearance.scss
Created December 16, 2019 17:50
MDC-based form-field standard appearance
@import '@material/rtl/mixins';
@import '@material/floating-label/mixins';
@import '@material/textfield/variables';
@import 'form-field-sizing';
// Styles for the standard appearance in the MDC-based form-field. MDC has styles for
// full-width text-fields which kind of look like the standard appearance. Though these
// styles cannot be used because they do not work for inputs with floating labels, or
// textareas which are intended to be displayed in the standard appearance. We create our
// own styles for the standard appearance that work for all types of inputs and textareas
import {Component, Injectable, NgModule} from '@angular/core';
/*
* Some service to test dependency injection. Not relevant to read.
*/
@Injectable({providedIn: 'root'})
export class SomeService {}
/*
@devversion
devversion / ts-ast-heritages.ts
Created February 8, 2017 22:22
TypeScript Member Heritage AST
sourceFiles.forEach(function(file) {
ts.forEachChild(file, visitNode);
});
/**
* @param {ts.Node} node
**/
function visitNode(node) {
if (!isNodeExported(node)) {
return;
@devversion
devversion / Dockerfile
Created October 31, 2016 14:35
Angular 2 Dockerfile Material 2
FROM node:latest
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy node package to working directory
COPY package.json /usr/src/app
# Install Node dependencies
@devversion
devversion / .block
Last active October 11, 2016 15:35 — forked from klabelle33/.block
Test
license: mit
#!/bin/bash
find . -type f -print | while read f; do
mv -i "$f" "$f.recode.$$"
iconv -f iso-8859-1 -t utf-8 < "$f.recode.$$" > "$f"
rm -f "$f.recode.$$"
done