Skip to content

Instantly share code, notes, and snippets.

View MuhiaKevin's full-sized avatar
🎯
Focusing

Muhia Kahiga MuhiaKevin

🎯
Focusing
  • Naivasha, Kenya
View GitHub Profile
@MuhiaKevin
MuhiaKevin / youtube-sort-videos-by-length.md
Created January 3, 2024 17:26 — forked from przemoc/youtube-sort-videos-by-length.md
Bookmarklet for YouTube: Sort videos by length in videos tab

Bookmarklet for YouTube: Sort videos by length in videos tab

On channels in videos tab you can sort videos by:

  • Most popular
  • Date added (oldest)
  • Date added (newest)

But you cannot sort by length. So I decided to create a bookmarklet to do it in ascending order.

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

@MuhiaKevin
MuhiaKevin / firefox-developer-edition.md
Created July 14, 2023 09:57 — forked from mahammad/firefox-developer-edition.md
How To install Firefox Developer Edition and create desktop icon for Ubuntu 14.04 LTS

chose other install way

  1. Open Terminal Ctrl+Alt+T Download Firefox Developer Edition tar file

    wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US

  2. Copy tar file to opt sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2

  3. Open opt folder (cd /opt/) and untar file sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2

@MuhiaKevin
MuhiaKevin / vscode_shortcuts.md
Created March 9, 2020 21:16 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

function timeConversion(stringg){
let hour = stringg.substring(0,2)
let mins = stringg.substring(3,5)
let seconds = stringg.substring(6,8)
let timeconvention = stringg.substring(8,10)
let rest = stringg.substring(2,8)
if(timeconvention == 'PM'){
if(parseInt(hour) != 12){
let hour1 = 0
def timeConversion(stringg):
hour = stringg[:2]
mins = stringg[3:5]
seconds = stringg[6:8]
timeconvention = stringg[8:]
rest = stringg[2:8]
if int(hour) >= 1 and int(hour) <= 12 and int(mins) >= 0 and int(mins) <= 59 and int(seconds) >= 0 and int(seconds) <= 59:
if(timeconvention == 'PM'):
if(int(hour) is not 12):