Skip to content

Instantly share code, notes, and snippets.

@theinvensi
theinvensi / pagedjs-repeat-table-header.js
Last active October 25, 2024 19:21
pagedjs-repeat-table-header
class RepeatTableHeadersHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller)
this.splitTablesRefs = []
}
afterPageLayout(pageElement, page, breakToken, chunker) {
this.chunker = chunker
this.splitTablesRefs = []
@riston
riston / remove.js
Last active December 12, 2022 15:21
Remove empty objects from object, recursive
var removeEmpty = function(object) {
if (!_.isObject(object)) {
return;
}
_.keys(object).forEach(function(key) {
var localObj = object[key];
@altintx
altintx / swipe_to_delete.js
Created April 20, 2012 19:26
Swipe to Delete on Sencha Touch 2.0 list
/* Assuming:
* dataview is a { xtype: "list" }
* dataview.itemTpl includes a <div class="deleteplaceholder"></div>
*
* Delete button will disappear as soon as something is touched
*/
dataview.on("itemswipe", function(dataview, ix, target, record, event, options) {
if (event.direction == "left") {
var del = Ext.create("Ext.Button", {
@rkumar
rkumar / colormap.sh
Created December 6, 2011 07:25
colormap.sh - bash color mappings
export NONE=''
export BLACK='\\033[0;30m'
export RED='\\033[0;31m'
export GREEN='\\033[0;32m'
export BROWN='\\033[0;33m'
export BLUE='\\033[0;34m'
export PURPLE='\\033[0;35m'
export CYAN='\\033[0;36m'
export LIGHT_GREY='\\033[0;37m'
export DARK_GREY='\\033[1;30m'