Skip to content

Instantly share code, notes, and snippets.

View mikailyusuf's full-sized avatar

Mikail Yusuf mikailyusuf

  • Nigeria
View GitHub Profile
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active March 23, 2026 03:03
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@gpetuhov
gpetuhov / retrofit_upload_image.kt
Last active June 22, 2021 19:23
Retrofit upload selected image
// Retrofit upload selected image
// https://futurestud.io/tutorials/retrofit-2-how-to-upload-files-to-server
// === Retrofit service ===
interface MediaService {
@Multipart
@POST("url")
suspend fun upload(
@Part("description") description: RequestBody,
@nnsnodnb
nnsnodnb / AnyError.swift
Last active March 17, 2025 12:14
How to upload jpeg image using URLSession.
import Foundation
struct AnyError: Error {
let error: Error
init(_ error: Error) {
self.error = error
}
}
@endy-s
endy-s / android-kotlin-social-media-deep-links.md
Last active September 17, 2022 12:03
Android Kotlin - Methods to open social media apps using deep links
@ptkdev
ptkdev / android-restore-password-keystore-jks.md
Last active March 28, 2023 15:51
Android: Recovery lost keystore jks file or keystore password

Sign android app with new keystore file if you missing password or lost jks file.

  1. Create new keystore.jks file with comand line (not android studio build menu)

    Linux: keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks

    Windows: "C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"

  2. Generate a .pem file from new keystore

@Silverbaq
Silverbaq / Server.kt
Created January 1, 2018 21:15
A simple socket-server written in Kotlin
package dk.im2b
import java.io.OutputStream
import java.net.ServerSocket
import java.net.Socket
import java.nio.charset.Charset
import java.util.*
import kotlin.concurrent.thread
@tejpratap46
tejpratap46 / PDFUtil.java
Last active February 23, 2022 06:18
Android Generate PDF from view, Use https://github.com/tejpratap46/PDFCreatorAndroid for simple use
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.pdf.PdfDocument;
import android.graphics.pdf.PdfRenderer;
import android.os.AsyncTask;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.util.Log;
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active April 7, 2026 13:18
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th