Shortcut | Description |
---|---|
Ctrl+Shift+P | command prompt |
Ctrl+Alt+P | switch project |
Ctrl+P | go to file |
Ctrl+G | go to line |
#! /bin/bash | |
cd $(mktemp -d) | |
wget https://aur.archlinux.org/cgit/aur.git/snapshot/insomnia.tar.gz | |
tar xzf insomnia.tar.gz | |
cd insomnia | |
makepkg -s | |
sudo pacman -U insomnia-*-x86_64.pkg.tar |
I created a new htaccess generator for angular apps that makes it easier for you to create the optimal htaccess file: https://julianpoemp.github.io/ngx-htaccess-generator/
The goal of this generator is to create the optimal .htaccess file for Angular apps easily. By default the generator creates an .htaccess file that solves the route redirection issue. To make it easier for you I created a kind of interview mode with some questions. As an additional feature the generator supports adding exclusions for example if you have installed a blog in a subdirectory of your web application and more!
The generator 😁: https://julianpoemp.github.io/ngx-htaccess-generator/
The project: https://github.com/julianpoemp/ngx-htaccess-generator
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({name: 'slugify'}) | |
export class SlugifyPipe implements PipeTransform { | |
transform(input: string): string { | |
return input.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text |
license: gpl-3.0 | |
height: 32 | |
border: no |
Electron is tricky to get set up on Windows Subsystem for Linux, but it can work!
Four things needed overall:
- you need WSL2, not WSL1
- you need node, of course, and that part isn't so bad
- you need to
apt install
several dependencies - you need an X Server so it can display the electron GUI over in Windows-land
Setup instructions, in order:
export class BaseService<T> { | |
protected resource: string // table name | |
constructor(protected supabase: SupabaseService, resource: string) { | |
this.resource = resource | |
} | |
findById(id: number, select = '*'): Observable<T> { | |
const query = this.supabase.table(this.resource).select(select).match({ id }).single() | |
return from(query).pipe(map((res) => res.body as T)) |
const ColorSteps = (() => { | |
/** | |
* Convert any color string to an [r,g,b,a] array. | |
* @author Arjan Haverkamp (arjan-at-avoid-dot-org) | |
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)' | |
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color. | |
* @see https://gist.github.com/av01d/8f068dd43447b475dec4aad0a6107288 | |
*/ | |
const colorValues = color => { |
# $HOME/.config/alacritty/alacritty.toml | |
# by Rito Ghosh 2023-10-06 | |
# Alacritty now uses TOML formatting for its config files. | |
# This is a simple example. | |
# There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd | |
# It is not obvious how it translates to TOML. But it is extremely straightforward. | |
# example: WINDOW, COLORS, etc. are tables, and should be represented as [window], [colors], respectively. |