Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@canthony
canthony / ExampleTableEditingUI.java
Created September 23, 2013 11:45
An example of In-Place table editing, with Buffered edits (i.e. commit/discard) Select a row and click edit (or double click a row) to edit a row. Make changes, and either click "Save" or "Cancel" to store those changes to the underlying item. "Enter" and "Escape" are keyboard shortcuts for Save and Cancel. Code is far from elegant - just illust…
package uk.org.backstage;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.data.Container;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ShortcutAction;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
@Cacodaimon
Cacodaimon / ChatClient.js
Created November 23, 2012 14:43
Used @ cacodaemon.de
module.exports.ChatClient = function () {
if (module.exports.ChatClient.instance) {
return module.exports.ChatClient.instance;
}
module.exports.ChatClient.instance = this;
this.host = null;
this.welcomeTime = 0;
var interval = null;
@adammessinger
adammessinger / jqm-reload-firstPage.js
Created May 24, 2012 03:33
jQuery Mobile Work-Around: refresh cached first page
// guarantee fresh data on the first-loaded page (stays cached in DOM)
// see https://github.com/jquery/jquery-mobile/issues/4050
$(document).on('pagebeforechange', function(event, data) {
var $all_pages = $.mobile.pageContainer.find(':jqmData(role="page")'),
$cur_page = $.mobile.activePage,
$first_page, // unenhanced if fresh load of URL w/ hash in browser w/o pushSate support
first_page_data,
toPage_type,
root_url,
nav_urls;
@andyedinborough
andyedinborough / jquery.oauth.js
Created June 7, 2011 19:30
Introduces $.oauth() to make using OAuth from jQuery as easy as using $.ajax()
(function (window, document, $, undefined) {
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!';
function require(name, url) {
if (window[name] === undefined)
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url });
}
$.oauth = function (options) {
var d = $.Deferred();
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE