Skip to content

Instantly share code, notes, and snippets.

View mukhtharcm's full-sized avatar
🎯
Focusing

Muhammed Mukhthar CM mukhtharcm

🎯
Focusing
View GitHub Profile
@emin-grbo
emin-grbo / decodeOrReport.swift
Created February 13, 2024 10:39
DecodeOrReport
// Used to detect specific issue with JSON decoding
func decodeOrReport(data: Data) {
do {
let _ = try JSONDecoder().decode(WidgetResponse.self, from: data)
print("\n\n👍ALL GOOD\n\n")
} catch DecodingError.keyNotFound( let key, let context) {
print("\n\n⛔️FAILED TO DECODE\n\n")
print("could not find key \(key) in JSON: \(context.debugDescription)")
} catch DecodingError.valueNotFound( let type, let context) {
print("\n\n⛔️FAILED TO DECODE\n\n")
@mandrean
mandrean / install-nodejs-lts-raspberry-pi-zero-w-armv6
Created November 7, 2022 11:22
Install NodeJS LTS on Raspberry Pi Zero W (ARMv6)
# update system
$ sudo apt update && sudo apt upgrade
# uninstall old node (v10?)
$ sudo apt remove nodejs npm -y
# install nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
# use 'unofficial builds' in nvm
@roipeker
roipeker / main.dart
Created March 9, 2021 01:41
Getx bottom navigation, subnav in home.
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(MyApp());
}
class MyNavModel {
static final Map<String, MyNavModel> urls = {};
final IconData icon;
@domenic
domenic / redirecting-github-pages.md
Created February 10, 2017 19:28
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.

The solution

@parmentf
parmentf / GitCommitEmoji.md
Last active April 25, 2024 08:18
Git Commit message Emoji
@gitaarik
gitaarik / git_submodules.md
Last active April 22, 2024 10:52
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.