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
| 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
| 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 plateNumberRexEx = /^(KWL|ABC|BWR|RSH|JJJ|AAA|LSR|FKJ|FST|APP|AGL|EPE|LND|MUS|KRE|FNN|SGB|LES|EDE|GBN|BAT|CRC|BDW|DDM|BKR|DMS|NGW|JBY|KFY|BRE|DJA|MLF|KTN|DTS|BDJ|GBR|SEY|LUY|AME|MAP|NRK|BJE|KAM|ANA|CAL|KMM|BRA|DUK|GEP|BNS|EFE|GGJ|CKK|TGD|UDU|BKS|GWL|NSR|UGG|KMC|TRN|DTF|DAL|KER|EFY|ADK|EMR|AMK|KLE|TUN|WEN|KEK|AKR|KTP|FFN|REE|SUA|JTA|NND|ABU|AHD|KNM|ABM|NDN|BGM|BNY|DEG|NCH|MHA|KHE|KPR|SKP|BRR|RUM|RGM|GGU|KRK|BER|PBT)-\d{3}[A-Z]{2}$/gi; | |
| function validatePlateNumber(pn: string): boolean{ | |
| return plateNumberRexEx.test(pn) | |
| } |
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 { Type } from '@nestjs/common'; | |
| import { | |
| ApiProperty, | |
| ApiPropertyOptions, | |
| ApiResponse, | |
| ApiResponseOptions, | |
| } from '@nestjs/swagger'; | |
| export const CustomApiResponseArray = <T>( | |
| entity: Type<T>, |
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
| fn prompt(msg:&str) -> String { | |
| println!("{msg}"); | |
| let mut input:String = String::new(); | |
| std::io::stdin().read_line(&mut input).expect("Could not read input"); | |
| return input; | |
| } | |
| let guess_value:String = prompt("How many times do you want to try"); |
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
| asyncapi: 2.4.0 | |
| info: | |
| title: Avro Example | |
| version: 1.0.0 | |
| description: |- | |
| An Avro example | |
| channels: | |
| 'tweets': | |
| description: This is the firehose of all Tweets |
NewerOlder