Skip to content

Instantly share code, notes, and snippets.

View kengoon's full-sized avatar
:octocat:
Awake to steal

Kenechukwu Akubue kengoon

:octocat:
Awake to steal
View GitHub Profile
from kivy.effects.scroll import ScrollEffect
from kivy.properties import NumericProperty
from kivy.effects.dampedscroll import DampedScrollEffect
class LowerScrollEffect(ScrollEffect):
friction = NumericProperty(0.027)
def on_overscroll(self, *args):
sv = self.target_widget.parent
@kengoon
kengoon / recycleview.py
Last active November 27, 2023 11:57
Kivy RecycleView with extra features
from kivy.uix.recycleview import RecycleView
from kivy.clock import Clock
from kivy.properties import OptionProperty, BooleanProperty, ObjectProperty, NumericProperty, ListProperty
from kivy.animation import Animation
from kivymd.uix.behaviors import StencilBehavior, SpecificBackgroundColorBehavior
from kivymd.uix.boxlayout import MDBoxLayout
from kivy.uix.widget import Widget
from Components.effects import LowerScrollEffect, LowerDampedScrollEffect
@kengoon
kengoon / opengl-fix-hd-graphics-windows-10.md
Created December 11, 2022 07:06 — forked from rb-dahlb/opengl-fix-hd-graphics-windows-10.md
OpenGL fix for Intel HD Graphics 3000 on Windows 10

Fix for Open GL on Intel HD Graphics 3000 - Windows 10

The drivers for Intel HD Graphics 3000 in Windows 10 does not expose all Open GL capabilities of the GPU. So software relying on Open GL features not present in Open GL 1.1 will not work. Using older versions of Windows or Linux might work since the chip have more features than the driver exposes.

The fix is to add a compatibility shim using the Windows ADK software.

1. Download and install Windows ADK

Link: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

@kengoon
kengoon / kivy_pdf.py
Created February 4, 2022 03:50 — forked from tshirtman/kivy_pdf.py
a very limited pdf viewer implemented directly with kivy widgets, using pdfminer to get the content
# adapted from https://github.com/dpapathanasiou/pdfminer-layout-scanner
from os.path import exists
from tempfile import mkdtemp, mkstemp
from shutil import rmtree
from binascii import b2a_hex
from os import write, close
from threading import Thread
from pdfminer.pdfpage import PDFPage
@kengoon
kengoon / datepicker.py
Last active November 22, 2023 08:44
A re-implementation of Adam's kivy widget (https://stackoverflow.com/users/1281548/adam) (https://stackoverflow.com/questions/13714074/kivy-date-picker-widget#) in Material Design using KivyMD
from kivy.event import EventDispatcher
from kivy.metrics import dp
from kivy.properties import ListProperty, StringProperty
from kivymd.uix.behaviors import FakeRectangularElevationBehavior
from kivymd.uix.card import MDCard
from kivy.uix.behaviors import ToggleButtonBehavior
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
@kengoon
kengoon / scratch_11.py
Created June 11, 2021 12:29
example of how to use icofont
import os
from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.label import MDIcon, MDLabel
from kivymd.uix.button import MDIconButton
from tools.iconfonts import icon, register
register("material", "fonts/MaterialIconsSharp-Regular.otf", "fonts/MaterialIconsSharp-Regular.fontd")
@kengoon
kengoon / iconfonts.py
Created June 11, 2021 12:27
create and use your own custom icon fonts(.css and .codepoint only!!)
import json
import re
import sys
from collections import OrderedDict
from kivy.compat import PY2
_register = OrderedDict()
if not PY2:
@kengoon
kengoon / ppa.sh
Created June 5, 2021 10:58
run ppa on parrot os and kali os
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
@kengoon
kengoon / List-Of-Emergency-Telephone-Numbers
Created April 2, 2021 08:23 — forked from immujahidkhan/List-Of-Emergency-Telephone-Numbers
List of emergency telephone numbers JSON
[
{
"Country": {
"Name": "Afghanistan",
"ISOCode": "AF",
"ISONumeric": "4"
},
"Ambulance": {
"All": [
"112"
@kengoon
kengoon / m_cardtextfield.py
Last active February 12, 2021 10:31
Kivy CardTextField
"""
M_CardTextField
"""
__all__ = ("M_CardTextField",)
from kivy.lang.builder import Builder
from kivy.metrics import dp
from kivymd.theming import ThemableBehavior
from kivymd.uix.boxlayout import MDBoxLayout
from kivymd.uix.button import MDIconButton