Skip to content

Instantly share code, notes, and snippets.

View pa4080's full-sized avatar
🎓
I'm learning

Spas Z. Spasov pa4080

🎓
I'm learning
View GitHub Profile
@pa4080
pa4080 / delete_git_submodule.md
Last active August 19, 2023 15:06 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file: nano .gitmodules or rm .gitmodules
  • Stage the .gitmodules changes: git add .gitmodules
  • Delete the relevant section from .git/config: nano .git/config
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule <name>"
  • Delete the now untracked submodule files rm -rf path_to_submodule
@pa4080
pa4080 / AuthyToOtherAuthenticator.md
Created April 4, 2023 18:15 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@pa4080
pa4080 / set-up-chromium-keys.md
Created December 23, 2021 10:21 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the chromium-dev@chromium.org mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur
@pa4080
pa4080 / TimedMediaHandlerHooks.patch
Last active May 16, 2020 09:13
Patch for MediaWiki Extension:TimedMediaHandler REL1_34 - allow the new Video Player for ALL users including anonymous
--- includes/TimedMediaHandlerHooks.php 2020-05-16 11:33:18.722588117 +0300
+++ includes/TimedMediaHandlerHooks.patch.php 11:32:52.290407251 +0300
@@ -592,7 +592,8 @@
) {
return 'videojs';
} else {
- return self::defaultPlayerMode();
+ return 'videojs';
+ //return self::defaultPlayerMode();
}
*** CollapsibleVectorHooks.php 2020-04-16 19:53:58.903979173 +0300
--- CollapsibleVectorHooks.patch.php 2020-04-16 19:53:17.347693246 +0300
***************
*** 46,51 ****
--- 46,56 ----
public static function isEnabled( $name ) {
global $wgCollapsibleVectorFeatures, $wgUser;
+ // Handle global false and anonymous users
+ $is_anonymosus_user = filter_var($wgUser, FILTER_VALIDATE_IP);
@pa4080
pa4080 / functions.php
Created October 11, 2019 04:56 — forked from RichardNesbitt/functions.php
WP Bakery Page Builder - Add URL option to make entire column clickable
/* add this to your theme's functions.php file */
/* Add option for URL to column settings */
vc_add_param("vc_column", array(
"type" => "vc_link",
"class" => "",
"heading" => "Column Link",
"param_name" => "column_link"
));
@pa4080
pa4080 / script-indicator.py
Last active June 21, 2021 07:42
A script that puts time indicator monitor in Ubuntu 16.04 task bar. Source: https://askubuntu.com/a/1040356/566421
#!/usr/bin/env python3
# References: https://askubuntu.com/a/1040356/566421
# https://gist.github.com/pa4080/4e498881035e2b5062278b8c52252dc1
import signal
import gi
import os
import subprocess
import sys
#!/bin/bash
echo -e "\nTerminal Clock\n"
while true; do
printf '%(%c)T\r' -1
done