Skip to content

Instantly share code, notes, and snippets.

View okineadev's full-sized avatar
🕊️

Okinea Dev okineadev

🕊️
View GitHub Profile
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active July 22, 2024 07:11
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@whunter
whunter / adb_rotation.sh
Created February 9, 2016 18:13
android device display rotation via adb
# disable auto rotation
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
# force landscape
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
# back to portrait
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
# upside down
@aklap
aklap / checking_shasums.md
Last active July 4, 2024 09:26
How to check a file's shasum

How to check file integrity with shasum


For verifying the integrity (but not authenticity of data, i.e., who authored it or the origin of the file) of a file, it is necessary to run a checksum function on the file which will output a value and compare it to a previously stored checksum value; if both values match, we can be relatively confident that the file hasn't been tampered with or altered.

You might be asked to verify a file's sha1sum or sha2sum–-all this means is calculating and verifying the cryptographic sha1 or sha2 hash value or digest included in the file.

Various commands and methods for verifying shasum 1 or 2:


Organic:
In terminal run:

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@imsus
imsus / sample.txt
Created February 6, 2019 10:13
Telegram Instant View Boilerplate
# This sample template explores how we can turn the Telegram blog post on the left into an Instant View page as shown on the right — in several simple steps. If you're unsure what some of the elements used here do, check out the full documentation here: https://instantview.telegram.org/docs
# Place the version at the beginning of template. We recommend always using the latest available version of Instant View.
~version: "2.0"
### STEP 1: Define which pages get Instant View and which don't
# That's easy because we only need IV pages for posts on the Telegram blog.
# This *condition* does the trick.
# ?path: /blog/.+
@HoussenMoshine
HoussenMoshine / telegram-instant-view-template-help
Last active July 14, 2024 07:03
Help for Telegram Instant View Template
# To remove only some text on a content
@remove: //p[self::p/strong[contains(text(), "Articles liés")]]
@remove: //iframe[contains(@src,"https://urlsomething")]
# To deal with fucking error of <img> is not supported in blabla
@before_el(./..): //a/img
@before_el(./..): //p/img
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active June 9, 2024 07:46
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@andriyudatama
andriyudatama / VS Code Disable GPU Acceleration
Last active July 10, 2024 20:08
Disable Hardware Acceleration (GPU) on Visual Studio Code
Visual Studio Code frequently crashes linux. Using NVIDIA GPU
1. Open command pallete (Ctrl + Shift + P)
2. Enter "Preferences: Configure Runtime Arguments"
3. Add config: "disable-hardware-acceleration": true
4. Restart VS Code
@lysender
lysender / export-import-gpg-keys.md
Created July 1, 2020 03:35
Export and import GPG Keys

Export public key

gpg --export your_address@example.net > my_key.pub 

The file can then be shared to other people.

Export public key in armor ascii format

@ArtMan-8
ArtMan-8 / Github-actions.md
Last active November 21, 2023 17:31
Базовая настройка github actions для запуска тестов и автоматической сборки проекта на gh-pages

Настройка github actions для тестов и сборки на gh-pages

Прежде всего нужно создать ключ для доступа к репозиториям. Один ключ можно использовать для разных репозиториев. Для этого идём в github, в настройки разработчика, и переходим к персональным токенам и жмём сюда для генерации ключа.


При генерации ключа отмечаем поля repo, workflow, user, даём название и копируем сам ключ.