Skip to content

Instantly share code, notes, and snippets.

View sod's full-sized avatar
🤨

Alexander von Weiss sod

🤨
View GitHub Profile
prompt(10)
#!/bin/bash
EXECUTABLE_WEBP_CHECK=$(brew ls --versions webp)
if [[ "" == "${EXECUTABLE_WEBP_CHECK}" ]]; then
echo "Error: 'cwebp' missing. Please install via 'brew install webp'"
exit 1
fi
processFile() {
function getContentsRelativeFromOrigin(filename: string | undefined, depth: number) {
let path = '.';
if (!filename?.startsWith('/')) {
const stack = new Error().stack!.split('\n');
const stack3 = stack[depth].split('(');
path = stack3.pop()?.replace?.(/(:\d+)*\).*$/, '') ?? '.';
}
return () => {
import {Directive, ElementRef, Input} from '@angular/core';
import {Observable, Subscription, of} from 'rxjs';
import {share} from 'rxjs/operators';
/**
* Adds the css class `active-animate` to the element, if given expression is truthy, but after a setTimeout without triggering change detection
* This allows to animate an element entering the view, as you can't have an animation on an element that was just added to the DOM
*
* Example:
*
import {Action, ActionCreator} from '@ngrx/store';
import {AbstractType, InjectionToken, Type} from '@angular/core';
import {Observable} from 'rxjs';
declare type DispatchType<T> = T extends {
dispatch: infer U;
}
? U
: true;
declare type ObservableType<T, OriginalType> = T extends false ? OriginalType : Action;
import {combineLatest, ObservableInput, OperatorFunction} from 'rxjs';
import {map, mergeMap, take} from 'rxjs/operators';
// if you need some extra values from other observables - preferably synchronous like ngrx state
//
// Example:
// this.action.pipe(
// ofType(myActionType),
// tap((myActionType) => {}), // <-- only has the action value
// mergeTakeOne(this.store.select(myStoreValue), /* andAnotherObservable$, andEvenMoreObservables$ */),
// https://bsaber.com/songs/top/page/2/?time=3-months&difficulty=expert-plus&ranked=false#038;difficulty=expert-plus&ranked=false
function getTitle(node) {
let artist = node.querySelector('.mapper_id').innerText;
let song = node.querySelector('.entry-title').innerText;
return `${artist} (${song})`.replace(/[^().-_a-z0-9[\] ]+/ig, '');
}
function getFile(node) {
Sie können immer montags bis freitags von 20 bis 3 Uhr des Folgetages sowie samstags, sonntags, am 24. und 31. Dezember sowie feiertags ganztägig einen Erwachsenen kostenlos mitnehmen.
#!/bin/bash
git fetch -p
CURRENT=`git rev-parse --abbrev-ref HEAD`
if [ "$CURRENT" != "master" ]; then
git checkout master
fi
var convertToString = function(array) {
return array.map((item, index) => '"' + index + ' ' + item.replace(/"/g, '') + '"').join('');
}
var find = function(needle, sourceAsString, source) {
var rx = new RegExp('"(\\d+) ([^"]*' + needle + '[^"]*)"','gi');
var i = 0, results = [];
while (result = rx.exec(sourceAsString)) {
results.push(result[1]);
if (results.length >= 100) {