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
prompt(10) |
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
#!/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() { |
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
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 () => { |
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
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: | |
* |
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
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; |
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
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$ */), |
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
// 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) { |
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
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. |
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
#!/bin/bash | |
git fetch -p | |
CURRENT=`git rev-parse --abbrev-ref HEAD` | |
if [ "$CURRENT" != "master" ]; then | |
git checkout master | |
fi |
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
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) { |
NewerOlder