Skip to content

Instantly share code, notes, and snippets.

View AbGhost-cyber's full-sized avatar
🎯
Focusing

Ab dremo AbGhost-cyber

🎯
Focusing
View GitHub Profile
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active July 21, 2024 08:16
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@meain
meain / loading_messages.js
Last active July 26, 2024 08:51
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@oooh-boi
oooh-boi / gist:a2e47433443125887d20aafd5cec7388
Created January 18, 2020 12:21
OoohBoi Video Tutorial : Full-height Image Widget in Elementor PRO
/* be sure to copy-paste to the Image Widget Custom CSS panel */
selector,
selector .elementor-widget-container,
selector .elementor-image,
selector .elementor-image > a {
height: 100%;
}
selector .elementor-image img {
object-fit: cover;
object-position: 50% 50%;
/*
* Based on https://gist.github.com/jamiesanson/d1a3ed0910cd605e928572ce245bafc4
*
* Refactored to use the preferred `DefaultLifecycleObserver` which does not rely on the annotation processor.
* See https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle#init
*
* Usage:
* `private var binding: TheViewBinding by viewLifecycle()`
*/
@EnesKaraosman
EnesKaraosman / SingleSelectionList.swift
Created July 9, 2020 10:19
Single item selection in a list in SwiftUI
struct SingleSelectionList<Item: Identifiable, Content: View>: View {
var items: [Item]
@Binding var selectedItem: Item?
var rowContent: (Item) -> Content
var body: some View {
List(items) { item in
rowContent(item)
.modifier(CheckmarkModifier(checked: item.id == self.selectedItem?.id))
viewPdf.visibility = View.VISIBLE
viewPdf.setOnClickListener {
//your action here
}
val countDown = 4000L
val countDownTimer = object : CountDownTimer(countDown, 1000) {
override fun onFinish() {
private fun checkWritePermissionAndProcessPdf() {
ActivityCompat.requestPermissions(
requireActivity(),
arrayOf(android.Manifest.permission.WRITE_EXTERNAL_STORAGE), REQUEST_CODE
)
if (checkSelfPermission(
requireContext(),
android.Manifest.permission.WRITE_EXTERNAL_STORAGE
)
== PackageManager.PERMISSION_GRANTED
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import android.os.Build
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
/**
@HassakuTb
HassakuTb / AndroidManifest.xml
Last active May 12, 2023 09:44
Reimplementation of UnityPlayerActivity with AppCompatActivity and Kotlin
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hassakulab.unitybridgesample"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.UnityBridgeSample">
@philipplackner
philipplackner / DeploymentSteps.txt
Created November 24, 2021 21:53
Ktor VPS Server Deployment Steps
1. Download Git Bash (only if on Windows)
2. Go to your users folder and open the .ssh folder. Then open Git Bash / Terminal there and generate a key pair:
ssh-keygen -m PEM -t rsa -b 2048
3. Copy the key to your server:
ssh-copy-id -i <keyname> <user>@<host>
5. Login to your Ubuntu server via SSH:
ssh -i <keyname> <user>@<host>