Skip to content

Instantly share code, notes, and snippets.

View pedroCX486's full-sized avatar
:shipit:
Let 'er rip!

pedrocx486 pedroCX486

:shipit:
Let 'er rip!
View GitHub Profile
@pedroCX486
pedroCX486 / misstodon.css
Last active February 16, 2023 01:49
Misstodon - A Misskey Inspired Mastodon Theme Override for the 4.x Interface
@media screen and (max-width: 1174px) {
.ui__header,
.navigation-panel {
background: #192320 !important;
}
}
body,
.sidebar-wrapper__inner,
.tabs-bar__wrapper {
@pedroCX486
pedroCX486 / debounce-example.ts
Created February 21, 2022 03:14
Debounce Example in Angular
private subject: Subject<any> = new Subject(); // What we need to trigger the debounce. A subject to keep it simple. Declare as a variable in your component.
this.subject.next(null); // Triggering the debounce using the subject. Call this anywhere. You can also pass anything as value.
this.subject.pipe(debounceTime(5000)).subscribe(() => { // The debounce with a 5 sec delay. Call this in a function onInit.
this.doHttpRequest().subscribe({ // The HttpClient request method to be debounced. Use any you want.
next: data => {
console.log(data);
},
error: error => {
@pedroCX486
pedroCX486 / blur-example.css
Created February 16, 2022 00:20
Create a semi-transparent div with a blurry background!
.blurry-semi-transparent-bg {
background-color: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(12px);
backface-visibility: hidden;
}
@pedroCX486
pedroCX486 / truncate_example.js
Last active December 28, 2019 21:16
Truncate in JS/TS
truncate(text, length) {
if (text.length <= length) {
return text;
} else {
return text.substring(0, length) + '...';
}
}