Selecting an item from GTK ListView widget.
Related issue https://discourse.gnome.org/t/gtk4-listview-why-does-the-single-click-activate-also-trigger-the-selected-event/7947
This file contains hidden or 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
| const addToBuildGradle = ( | |
| newLine: string, | |
| anchor: RegExp | string, | |
| offset: number, | |
| buildGradle: string, | |
| ) => { | |
| const lines = buildGradle.split('\n'); | |
| const lineIndex = lines.findIndex((line) => line.match(anchor)); | |
| // add after given line | |
| lines.splice(lineIndex + offset, 0, newLine); |
This file contains hidden or 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 { jwtDecode } from "jwt-decode"; | |
| import * as api from "./generated"; | |
| import { ApiRequestOptions } from "./generated/core/ApiRequestOptions"; | |
| import { toast } from "react-toastify"; | |
| import { storageKey } from "@/utils/keys"; | |
| api.OpenAPI.BASE = import.meta.env.VITE_APP_BASE_API; | |
| export const apiConfig = api; |
This file contains hidden or 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 edgeAwareSlice<T>(arr: Array<T>, start: number, win: number) { | |
| if(win > arr.length) { return arr } | |
| const half = Math.floor(win/2) | |
| let front = start - half | |
| let back = start + half; | |
| if (back >= arr.length){ | |
| // console.log('gap', {front, back, diff: (back+win%2) - arr.length}, arr.length) |
This file contains hidden or 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
| type LatLng = [number, number]; | |
| function decodePolyline(encoded: string): Array<LatLng> { | |
| const poly: Array<LatLng> = []; | |
| let index = 0; | |
| const len = encoded.length; | |
| let lat = 0, | |
| lng = 0; |
This file contains hidden or 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
| if [ -f ~/.bashrc ]; then . ~/.bashrc; fi | |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Path to your oh-my-zsh installation. | |
| export ZSH=$HOME/.oh-my-zsh | |
| # Set name of the theme to load --- if set to "random", it will | |
| # load a random theme each time oh-my-zsh is loaded, in which case, | |
| # to know which specific one was loaded, run: echo $RANDOM_THEME |
This file contains hidden or 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 { Injectable, InternalServerErrorException } from '@nestjs/common'; | |
| import { Storage, Bucket, File } from '@google-cloud/storage'; | |
| import StorageKeyFile from 'src/config/storage-service-account.json'; | |
| import { ConfigService } from '@nestjs/config'; | |
| import { ENV } from 'src/config'; | |
| import { BucketDirectories } from './constants'; | |
| @Injectable() | |
| export class StorageService { | |
| private gcStorage = new Storage({ |
This file contains hidden or 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 { | |
| CallHandler, | |
| ExecutionContext, | |
| Injectable, | |
| NestInterceptor, | |
| } from '@nestjs/common'; | |
| import { Response } from 'express'; | |
| import { map, Observable } from 'rxjs'; | |
| @Injectable() |
Succesfully deployed a firebase function, using a service account.
This was me trying not to use the ci token as it was flagged unsafe.
This gist contains the roles needed for your service account to deploy properly
This file contains hidden or 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
| const wmi = [ | |
| { | |
| "code": "AAA", | |
| "name": "Audi South Africa made by Volkswagen of South Africa" | |
| }, | |
| { | |
| "code": "AAK", | |
| "name": "FAW Vehicle Manufacturers SA (PTY) Ltd." | |
| }, | |
| { |
NewerOlder