Skip to content

Instantly share code, notes, and snippets.

View akshayaurora's full-sized avatar
🌴
Looking for a change

Akshay Arora akshayaurora

🌴
Looking for a change
View GitHub Profile
@akshayaurora
akshayaurora / behaviors.py
Created January 22, 2023 11:17
Date picker: Sample: Not directly usable. You need some additions with this like images for focus, glow, a theme folder in, a app.theme property etc.
'''
Custom Behaviors are defined in this module.
'''
from kivy.app import App
from kivy.animation import Animation
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.config import Config
@akshayaurora
akshayaurora / do_share_ios_kivy.py
Created May 31, 2022 15:27
Kivy Share file on iOS
app = App.get_running_app()
import ios
from pyobjus import autoclass
NSURL = autoclass('NSURL')
UIApplication = autoclass('UIApplication')
sharedApplication = UIApplication.sharedApplication()
def do_share_ios(data, title):
URL = NSURL.fileURLWithPath_(data)
UIActivityViewController = autoclass('UIActivityViewController')
@akshayaurora
akshayaurora / gist:34711aee4890345319bfab2b88ad69b2
Created May 12, 2022 19:40
Sample recipe on iOS using CMAKE
from kivy_ios.toolchain import Recipe, shprint
from os.path import join
import sys
import sh
class LFKBenchmarkRecipe(Recipe):
version = "main"
url = f'<your url here {version}.tar.gz>'
libraries = "lfk_benchmark/liblfk-benchmark.a", "lfk_benchmark/core/liblfk-core-nonoptimized.a", "lfk_benchmark/core/liblfk-core-optimized.a"
@akshayaurora
akshayaurora / ios_orientation_detector.py
Last active April 5, 2023 16:38
kivy kivy-ios iOS Listen for orientation changes and adjust for safe_areas/notch
import ios
from pyobjus import autoclass
UIDevice = autoclass('UIDevice')
CurrentDevice = UIDevice.currentDevice()
Logger.info(f'WaverianApp: iOs device name : {CurrentDevice.name.cString()}')
UIApplication = autoclass('UIApplication')
sharedApplication = UIApplication.sharedApplication()
NotchDetector = autoclass("NotchDetector").alloc().init()
@akshayaurora
akshayaurora / filechooser.py
Created June 11, 2021 20:41
Hacky code to experiment with opening media on iOS , copy paste code below `plyer/platforms/ios/filechooser`
'''
IOS file chooser
--------------------
This module houses the iOS implementation of the plyer FileChooser.
.. versionadded:: 1.4.4
'''
from plyer.facades import FileChooser
/home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target armv7-none-linux-androideabi -gcc-toolchain /home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 -mfloat-abi=softfp -mfpu=vfpv3-d16 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall --sysroot=/home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/sysroot -D__ANDROID_API__=21 -isystem /home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi --sysroot=/home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/sysroot -D__ANDROID_API__=21 -isystem /home/electrum/Downloads/android-ndk-r18b-linux-x86_64/android-ndk-r18b/sysroot/usr/include/arm-linux-androideabi -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-functi
@akshayaurora
akshayaurora / gist:f2377bafe37efc8a8d86daed7d5ca383
Created April 2, 2018 14:08
ether Swarm upload and download
previewHash(hash){
var preview = document.querySelector('img');
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Typical action to be performed when the document is ready:
preview.src = xhttp.responseText;
}
};
xhttp.open("GET", "http://swarm-gateways.net/bzz:/" + hash, true);

Keybase proof

I hereby claim:

  • I am akshayaurora on github.
  • I am quanon (https://keybase.io/quanon) on keybase.
  • I have a public key ASB3Lj1UxkUQbOgapVjug4a8O0hMyOSZzfZh6ohF7VTVogo

To claim this, I am signing this object:

>>> from pyobjus import autoclass
>>> from pyobjus.dylib_manager import load_framework, INCLUDE
>>> load_framework(INCLUDE.AppKit)
>>> nscreen = autoclass('NSScreen')
>>> screen_count = int(nscreen.screens().count())
>>> for scr in range(screen_count):
... screen = nscreen.screens().objectAtIndex_(0)
... print screen.frame.size.width, screen.frame.size.height
...
1680.0 1050.0
This file has been truncated, but you can view the full file.
./toolchain.py build openssl kivy pil
Want to build ['openssl', 'kivy', 'pil']
Loaded recipe openssl (depends of [], optional are [])
Loaded recipe kivy (depends of ['python', 'sdl2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'ios'], optional are [])
Loaded recipe pil (depends of ['hostpython', 'host_setuptools', 'pkgresources', 'freetype', 'libjpeg', 'python', 'ios'], optional are [])
Loaded recipe python (depends of ['hostpython', 'libffi'], optional are ['openssl'])
Loaded recipe sdl2 (depends of [], optional are [])
Loaded recipe sdl2_image (depends of ['sdl2'], optional are [])
Loaded recipe sdl2_mixer (depends of ['sdl2'], optional are [])
Loaded recipe sdl2_ttf (depends of ['sdl2', 'freetype'], optional are [])