Skip to content

Instantly share code, notes, and snippets.

@nafiesl
nafiesl / how_to_get_telegram_chat_id.md
Created December 20, 2023 11:49
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
@ibrahimlawal
ibrahimlawal / LC_CTYPE.txt
Created February 27, 2017 07:02 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@planetWayne
planetWayne / ReadME.rst
Last active April 25, 2024 06:45
Quick and Dirty walkthrough for setting up Enterprise WiFi on Unifi on Windows domain

Walk-through to setup Enterprise Wifi with Unifi on Windows Server =================================================================

Update 14/02/2024 : Added step 3-d - allowing the cert template to be issued by a CA

Why

Quite simply, you will have the ability to log on to your Company Wifi network using your Windows Domain Username and Password. No more remembering someone else's idea of a secure password. A Single Sign-on for all resources.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 25, 2024 06:45
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@dnlvgl
dnlvgl / 90-kensington-expert-trackball-remap.hwdb
Created January 25, 2020 23:03
Remapping Kensington Expert Trackball Buttons with wayland
# Button remap for Kensington Expert Trackball
# both upper buttons (90003 + 90004) act as BTN_LEFT (272)
# both lower buttons (90001 + 90002) act as BTN_RIGHT (273)
# save this file under '/etc/udev/hwdb.d/90-kensington-expert-trackball-remap.hwdb'
# run `sudo systemd-hwdb update` and reboot
#
# source: https://askubuntu.com/questions/1145057/remapping-mouse-buttons-to-keyboard-keys
# /sys/class/input/event20/device/id/bustype:0003
# /sys/class/input/event20/device/id/product:1020
# /sys/class/input/event20/device/id/vendor:047d
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Weather App</title>
<style>
h1,
h2,
@mwaskom
mwaskom / replacing_seaborn_distplot.ipynb
Last active April 25, 2024 06:42
A guide to replacing the deprecated `seaborn.distplot` function.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PoomSmart
PoomSmart / YouTubeDefaultVideoQuality.x
Last active April 25, 2024 06:41
Sets the default video quality for videos on iOS YouTube.
#import <YouTubeHeader/MLHAMPlayerItem.h>
#import <YouTubeHeader/MLQuickMenuVideoQualitySettingFormatConstraint.h>
int targetResolution = 1440;
int targetFPS = 60;
static NSString *getClosestQualityLabel(NSArray <MLFormat *> *formats) {
int minDiff = INT_MAX;
int selectedFPS = 0;
NSString *closestQualityLabel;
@JohnSundell
JohnSundell / ContentViewWithCollapsableHeader.swift
Last active April 25, 2024 06:41
A content view which renders a collapsable header that adapts to the current scroll position. Based on OffsetObservingScrollView from https://swiftbysundell.com/articles/observing-swiftui-scrollview-content-offset.
import SwiftUI
/// View that observes its position within a given coordinate space,
/// and assigns that position to the specified Binding.
struct PositionObservingView<Content: View>: View {
var coordinateSpace: CoordinateSpace
@Binding var position: CGPoint
@ViewBuilder var content: () -> Content
var body: some View {
@ssokolow
ssokolow / update_flatpak_cli.py
Last active April 25, 2024 06:40
Utility for making Flatpak-installed apps available in the terminal through their normal command names
#!/usr/bin/env python3
"""Flatpak CLI Shortcut Generator
A simple no-argument tool that generates launchers with traditional non-flatpak
command names for your installed Flatpak applications in ~/.local/bin/flatpak.
Does full collision detection and warns you if you forgot to add its output
directory to your PATH. Also overrules the command-line specified in the
``.desktop`` file if the Flatpak maintainer didn't include support for
command-line arguments.