Skip to content

Instantly share code, notes, and snippets.

View Aybee5's full-sized avatar
🎯
Focusing

Ibrahim Abdullahi Aliyu Aybee5

🎯
Focusing
View GitHub Profile
@Aybee5
Aybee5 / README.md
Last active April 26, 2025 19:05
KDE Connect NetworkManager Auto-Refresh Script

KDE Connect NetworkManager Auto-Refresh Script

This guide helps you set up a script that automatically refreshes KDE Connect when your network connects. This solves the common issue where KDE Connect devices don't reconnect properly after your computer changes networks.

Problem

When your computer connects to a new network, KDE Connect doesn't always automatically discover your previously paired devices. This creates a frustrating experience where you need to manually refresh the connection.

Solution

Create a NetworkManager dispatcher script that automatically calls kdeconnect-cli --refresh whenever a network connection is established.

@Aybee5
Aybee5 / recover.js
Last active December 15, 2020 10:25
Recover deleted documents in couchdb using javascript
function recover(num) {
docId = app[num]
console.log(`${dbendpoint}/${dbName}/${docId}/?revs=true&open_revs=all`)
axios
.get(`${dbendpoint}/${dbName}/${docId}/?revs=true&open_revs=all`)
.then((result) => {
data = JSON.parse(
result.data.substring(
result.data.indexOf("{"),
result.data.lastIndexOf("}") + 1
let dynamicCacheName = "dynamic",
showNotifications = (t) => {
self.registration.showNotification(t, {
body: "Reminder",
badge: "https://ibb.co/Lp2LyG3",
tag: Date.now().toString(36),
actions: [
{ action: "view", title: "View" },
{ action: "discard", title: "Discard" },
],
@Aybee5
Aybee5 / script.js
Created July 14, 2020 20:16
The Script of api-tutorial
const base_url = ""
const api_key = ""
const date = new Date()
document.getElementById("date").innerHTML = date
let searchKey = document.getElementsByClassName("search-bar")[0]
let countryName = document.getElementById("country-name")
@Aybee5
Aybee5 / style.css
Created July 10, 2020 21:41
The Style of api-tutorial
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'montserrat', sans-serif;
}
#app {
background-image: url('./img/cold-bg.jpg');
@Aybee5
Aybee5 / index.html
Created July 10, 2020 21:21
The Markup of api-tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>api-tutorial</title>
<link rel="stylesheet" href="style.css">
</head>
@Aybee5
Aybee5 / App.vue
Last active October 14, 2019 18:08 — forked from spemer/App.vue
App.vue -> axios
<template lang="pug">
<div id="app">
<div
v-for="user in users"
:key="users.id"
>
<h1> {{ user.name }} </h1>
<p> {{ user.email }} </p>
<button> (@click="fetchUsers") Click me! </button>
</div>