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 React, { useEffect } from "react"; | |
import { Store } from "@tanstack/store"; | |
import { useStore } from "@tanstack/react-store"; | |
type RouteParams = Record<string, string>; | |
type QueryParams = URLSearchParams; | |
interface Route { | |
path: string; | |
component: React.ComponentType<{ params: RouteParams; query: QueryParams }>; |
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 requests | |
# Your Google Maps API key | |
API_KEY = 'YOUR_API_KEY' | |
# The list of petrol stations you have | |
# Example: [{'name': 'Rubis Karen', 'latitude': -1.2921, 'longitude': 36.8219}] | |
petrol_stations = [...] # replace with your actual list | |
def get_road_name(lat, lon, api_key): |
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
*, | |
*::before, | |
*::after { | |
box-sizing: border-box; | |
margin: 0; | |
padding: 0; | |
font-size: 1.4rem; | |
line-height: 1.5; | |
} |
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
this worked very nice for a single page site | |
``` | |
wget \ | |
--recursive \ | |
--page-requisites \ | |
--convert-links \ | |
[website] | |
``` | |
wget options |
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
# From my webinar for Sysdig - Exploring Kubernetes 1.18 | |
# Create A KinD or k3s cluster with no IngressController | |
# Run `arkade install ingress-nginx` to add IngressNginx to the cluster as your IngressController | |
# Save and apply all the Kubernetes YAML files below | |
# Forward the IngressController | |
# kubectl port-forward ingress-nginx-controller 8080:80 |
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
commit 5ec98e672d66bfa1e0dce315a8b85827372d3570 | |
Author: Alloys Mila <[email protected]> | |
Date: Tue Jan 5 11:59:15 2021 +0300 | |
readme: Include screenshots | |
commit a2710c6d4574beba10a75fa6ab00885fa0fd2dcd | |
Author: Alloys Mila <[email protected]> | |
Date: Tue Jan 5 11:54:54 2021 +0300 |
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
sudo apt install gnupg | |
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list | |
sudo apt update | |
sudo apt-get install -y mongodb-org |
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
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
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
#Download Elementary OS from here: | |
#https://elementary.io/ | |
#Clean-up System | |
sudo apt-get purge midori-granite -y | |
sudo apt-get purge yelp -y | |
sudo apt-get purge evince -y | |
sudo apt-get purge gnome-orca -y | |
sudo apt-get autoremove -y | |
sudo apt-get autoclean -y |
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
#! /usr/bin/env python3.5 | |
""" | |
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5. | |
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197 | |
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone. | |
This will be only fixes the bluez5 problem mentioned above . |
NewerOlder