This file contains hidden or 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
this.addEventListener('touchstart', function(e) { | |
for(var i in e.touches) { | |
var touch = e.touches[i]; | |
var node = touch.target; | |
if (node.className == 'bubble') { | |
node.className = 'bubble done'; | |
PhoneGap.exec("SoundPlug.play", "sound.m4a"); | |
} | |
} |
This file contains hidden or 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
----------------------------------------------------------------------------------------- | |
-- | |
-- modal.lua | |
-- | |
-- Modal dialog for Corona SDK | |
-- V. Sergeyev | |
-- | |
-- Usage: | |
-- showDialog("You completed the level. \n1st place.", "Next level", "level2", beforeNext) | |
-- |
This file contains hidden or 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
display.setStatusBar( display.DefaultStatusBar ) | |
local widget = require "widget" | |
local sbHeight = display.statusBarHeight | |
local tbHeight = 44 | |
local top = sbHeight + tbHeight | |
-- forward declarations | |
local titleField, noteText, loadSavedNote, saveNote |
This file contains hidden or 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
<html> | |
<link rel="stylesheet" type="text/css" href="https://cdn.widget.dev.odeskps.com/static/default_widget_look.css" /> | |
<script src="https://cdn.widget.dev.odeskps.com/static/js/jquery.min.js"></script> | |
<script src="https://cdn.widget.dev.odeskps.com/static/widget-app.js"></script> | |
<script> | |
(new WidgetsProducerBase()).contractors({ | |
'q': 'python', | |
'id': 'odesk-widget', | |
'perPage': 5 | |
}); |
This file contains hidden or 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 os | |
import webapp2 | |
from base import admin_required, BaseHandler | |
# import your models here, required for eval() | |
actions_map = { | |
"c": "Add", | |
"r": "List", | |
"u": "Edit", |
This file contains hidden or 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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> | |
<script type='text/javascript' src='https://cdn.firebase.com/v0/firebase.js'></script> | |
<script src="firebase-models.js"></script> | |
<script> | |
var Chat = {}; | |
$.extend(Chat, FirebaseModels.Model, { | |
type: "Chat", | |
firebase: new Firebase("https://blabla.firebaseio-demo.com/Chat/") | |
}); | |
This file contains hidden or 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 bottle import * | |
from bottlepy_user_auth import User | |
def validate_login(): | |
return User().loggedin | |
def login_required(view, check_func=validate_login): | |
''' |
This file contains hidden or 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
bootbox.upload("Choose file", "/file_upload/", function($form) { | |
if (!$form) return; | |
var form_data = new FormData(); | |
form_data.append("file", $form.find("input[type='file']")[0].files[0]); | |
$.ajax({ | |
url: $form.attr("action"), | |
processData: false, // Important! | |
contentType: false, // Important! |
This file contains hidden or 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
var form = $("<form></form>"); | |
form.append("<label>Title:</label> <input type=text name='title' />"); | |
form.append("<label>Description:</label> <textarea name='description'></textarea>"); | |
bootbox.form("Project settings", form, function($form) { | |
if (!$form) return; | |
var settings = {}; |
This file contains hidden or 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
$(".draggable").on("dragstart", function (e) { | |
var url = "application/octet-stream:" + your_file_title + ":" + your_file_url_on_server; | |
e.dataTransfer.setData("DownloadURL", url); | |
}); |
OlderNewer