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
''' Code Inspired by http://github.com/tito 's NFC gist
This is a complete implementation allowing for NFC tag or p2p detection
Allows you to create any type of NdefRecord using functions like
`create_RTDURI(uri)`
This is the Android implementatoin of NFC Scanning using the
built in NFC adapter of some android phones.
'''
from kivy.app import App
from kivy.clock import Clock
@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 / 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 / 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
'''This is a simple example of how to use suggestion text.
In this example you setup a word_list at the begining. In this case
'the the quick brown fox jumps over the lazy old dog'. This list along
with any new word written word in the textinput is available as a
suggestion when you are typing. You can press tab to auto complete the text.
'''
import sys
from kivy.clock import Clock
from kivy.app import App
from kivy.uix.textinput import TextInput
/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: