Skip to content

Instantly share code, notes, and snippets.

View diegodario88's full-sized avatar
🏠
Working from home

Dario diegodario88

🏠
Working from home
  • Home
  • Maringá, Paraná, Brasil
  • 14:17 (UTC -03:00)
View GitHub Profile

GNOME extension with TypeScript (for autocomplete)

One of the downsides of developing GNOME extensions is not having autocomplete in your editor, which makes life really hard when you don't know where to look for documentation and don't know much about GLib and Gnome Shell. To solve that, we can create our project using TypeScript and the types defined in the ts-for-gir project.

But before that, let's talk about expectations. I'm not going to show how to configure any specific editor. This setup is editor-agnostic and if you have a

@felinto-dev
felinto-dev / api-nests.service.ts
Created August 21, 2022 10:20
Axios Cache Wrapper for NestJS
import { HttpService } from '@nestjs/axios';
import { Injectable } from '@nestjs/common';
import {
setupCache,
buildMemoryStorage,
defaultKeyGenerator,
} from 'axios-cache-interceptor';
@Injectable()
export class ApiService {
@VitorLuizC
VitorLuizC / 0. useIdentify.ts
Created May 26, 2021 23:22
React.js useIdentify hook that generates an unique id with really random generated numbers for each name provided.
import { useCallback, useMemo } from 'react';
import generateHash from './generateHash.js';
export type Identify = (name: string) => string;
function useIdentify(): Identify {
const ids = useMemo(() => new Map<string, string>(), []);
return useCallback((name) => {
if (!ids.has(name)) {
@Underknowledge
Underknowledge / fedora_v4l2loopback_and_signing.sh
Last active December 18, 2025 12:00
Install and sign v4l2loopback in fedora
#!/usr/bin/env bash
# set -x
Git_status=$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/umlaeute/v4l2loopback/tags" )
TAR_dl=$( echo "${Git_status}" | jq -r ".[].tarball_url" | head -n1)
TAR_v=$( echo "${Git_status}" | jq -r ".[].name" | head -n1)
build_dir="${build_dir:-/usr/src/v4l2loopback-"${TAR_v}"}"
tmp_dir="${tmp_dir:-/tmp}"
mokutil_out_dir="${mokutil_out_dir:-/root/.ssh/mokutil-module-signing}"
@johnathanmay
johnathanmay / logitech-mx-master-3-extras-for-linux-with-logiops.md
Last active March 7, 2026 07:12
How to install and configure PixlOne's logid to program Logitech MX Master 3 buttons on Linux.

Logitech MX Master 3 Extras for Linux With logiops

The Logitech Options program isn't available for Linux, but by a nice guy on GitHub (PixlOne) created an open source project that lets you obtain some of that functionality. It's called logiops. It works in conjunction with the Solaar project as well, which I find especially handy since that shows your available battery life in the system tray and lets you pair/unpair devices with the Logitech Unifying Receiver.

Here are some additional pages with info that I used to generate this documentation:

@vicentimartins
vicentimartins / docker-compose.yml
Last active November 26, 2020 20:30
Xdebug on VSCode using docker
version; '3.7'
services:
php:
volumes:
- ...
other_settings:
- ...
enviroment:
...
@ikurni
ikurni / install-snx-checkpoint
Last active February 19, 2025 06:34
How to install SNX Checkpoint VPN client in Fedora 33
### Install few required packages to run SNX
sudo dnf install -y java-1.8.0-openjdk.x86_64 icedtea-web.x86_64 libstdc++.i686 libX11.i686 libpamtest.i686 libnsl.i686
### Download compat-libstdc++ driver and install it
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.i686.rpm
sudo dnf -y install compat-libstdc++-33-3.2.3-72.el7.i686.rpm
### Install snx_linux.sh
### Download snx_linux_30.sh file from Checkpoint
### Active URL : https://supportcenter.checkpoint.com/supportcenter/portal/user/anon/page/default.psml/media-type/html?action=portlets.DCFileAction&eventSubmit_doGetdcdetails&fileid=22824
<!doctype html>
<html lang="pt_BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>DataTable ++PHP</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.18/css/dataTables.bootstrap4.min.css"/>
version: '3'
# Networks
networks:
# Internal network
internal:
driver: bridge
# Volumes
volumes:
@victorcrbt
victorcrbt / Client.ts
Last active August 8, 2025 06:36
TypeORM ManyToMany relation with custom pivot table and column names.
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable } from 'typeorm';
import Company from './Company';
@Entity('clients')
export default class Client {
@PrimaryGeneratedColumn()
id: number;
@Column()