This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Refactoring tool using ChatGPT from Vue 2 to Vue 3 | |
$ export OPENAPI_APIKEY=sk......... | |
$ python refactor.py MyView.vue | |
""" | |
import os | |
import re | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to add in the spcec: | |
android.api = 28 | |
android.minapi = 26 | |
android.ndk = 17c | |
p4a.hook = p4a_hook.py | |
# i have my own set of java tools, don't use it if you don't want it | |
android.add_src = java/src/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GISTS_DIR=~/.gists | |
FILENAME=$1.tar.gz | |
if [ "X$1" == "X" ]; then | |
echo "Usage: gist <gistid>" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Kivy audio implementation for Android using native API | |
====================================================== | |
""" | |
from jnius import autoclass | |
from kivy.core.audio import Sound, SoundLoader | |
MediaPlayer = autoclass("android.media.MediaPlayer") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Bluetooth/Pyjnius example | |
========================= | |
This was used to send some bytes to an arduino via bluetooth. | |
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
tested without BLUETOOTH_ADMIN, maybe it works.) | |
Connect your device to your phone, via the bluetooth menu. After the | |
pairing is done, you'll be able to use it in the app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
class Point(ctypes.Structure): | |
_fields_ = ( | |
("x", ctypes.c_int), | |
("y", ctypes.c_int)) | |
p1 = Point(23, 4) | |
print 'Original point is', (p1.x, p1.y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
""" | |
Pchip implementation in pure numpy | |
.. author:: Michael Taylor <mtaylor@atlanticsciences.com> | |
.. author:: Mathieu Virbel <mat@meltingrocks.com> | |
Copyright (c) 2016 Michael Taylor and Mathieu Virbel | |
Permission is hereby granted, free of charge, to any person obtaining a copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Kivy/ffpyplayer example to read transparent video | |
================================================= | |
Right now, VP9/ffmpeg encoder supports alpha channel, under the yuva420p | |
pixel format. But for decoding, the default libvp9 used by ffmpeg doesn't | |
support it, so we need to ask for libvpx-vp9 instead. | |
I was using a set of png image as a source, and got a VP9+alpha video with:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.graphics.texture import Texture | |
from kivy.graphics import Rectangle, Color | |
from kivy.uix.widget import Widget | |
from kivy.graphics.opengl import glFinish | |
from kivy.app import App | |
from time import time | |
class RadialGradient(App): | |
def build(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.uix.relativelayout import RelativeLayout | |
from kivy.properties import BooleanProperty, NumericProperty | |
from kivy.animation import Animation | |
class VisibleContainer(RelativeLayout): | |
visible = BooleanProperty(True) | |
animated = BooleanProperty(False) | |
duration = NumericProperty(0.2) | |
capture = BooleanProperty(False) |
NewerOlder