Skip to content

Instantly share code, notes, and snippets.

@encela95dus
encela95dus / Dropbox File Picker V2.py
Last active February 1, 2021 03:22
Dropbox File Picker V2.py
#!python3
#original code https://gist.github.com/omz/fb180c58c94526e2c40b
#bosco added changes dropbox 2 functionality
#minor edits done to run in python3
#see forum post https://forum.omz-software.com/topic/4425/dropbox-file-picker-needs-update
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
@encela95dus
encela95dus / customslider.py
Created August 5, 2019 04:12
customslider.py
import ui
class CustomSlider(ui.View):
def __init__(self,*args,**kwargs):
super().__init__(*args, **kwargs)
@property
def value(self):
return self.__value
@encela95dus
encela95dus / moveimage.py
Created October 29, 2018 09:13
moveimage.py
import ui
class MoveView(ui.View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.current_location = None
self.image = ui.Image('test:Mandrill')
self.iv = ui.ImageView(image=self.image)
self.add_subview(self.iv)
@encela95dus
encela95dus / interactive_quiz.py
Created October 16, 2018 11:03
interactive_quiz.pyui
import ui
questions = [('Which is the smallest planet in the solar system?',
('mercury', 'mars', 'saturn'), 0),
('which one is the moon of the saturn?',
('io', 'enceladus', 'europa'), 1),
('Which is the largest planet in the solar system?',
('mercury', 'mars', 'jupiter'), 2)]
class QuizDialog(object):
@encela95dus
encela95dus / sketch2.py
Created September 20, 2018 09:41
sketch2.py
'''
A very simple drawing 'app' that demonstrates
custom views and saving images to the camera roll.
'''
import ui
import photos
import console
# The PathView class is responsible for tracking
@encela95dus
encela95dus / navtest_mainview.pyui
Created August 15, 2018 12:55
simple_navigation_view.py
[
{
"class" : "View",
"attributes" : {
"name" : "Main View",
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
"enabled" : true,
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
"flex" : ""
@encela95dus
encela95dus / navtest_mainview.pyui
Created August 15, 2018 03:30
navtest_mainview.pyui
[
{
"class" : "View",
"attributes" : {
"name" : "Main View",
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
"enabled" : true,
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
"flex" : ""
import scene
import random
import ui
import sound
class Block(scene.SpriteNode):
for effect in ['Click_1', 'Click_2', 'Coin_2', 'Coin_5']:
sound.load_effect(effect)
w, h = (96, 96) # (64, 64)
@encela95dus
encela95dus / moreorless.js
Created March 6, 2018 07:12
testjquery.py
$(document).ready(function() {
$('a.moreorless').click(function() {
var $firstPara = $('p:eq(1)');
$firstPara.slideToggle('slow');
var $link = $(this);
if ( $link.text() == "read more" ) {
$link.text('read less');
} else {
$link.text('read more');
}
@encela95dus
encela95dus / pyui_dialog.pyui
Created November 17, 2017 06:29
test_pyui_dialog.py
[
{
"class" : "View",
"attributes" : {
"background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)",
"tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)",
"enabled" : true,
"border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)",
"flex" : ""
},