Skip to content

Instantly share code, notes, and snippets.

View kwk's full-sized avatar

Konrad Kleine kwk

View GitHub Profile
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
find: `node_modules/': No such file or directory
buildDevelopment \
--cssimports \
--root=http-pub \
--label Ext:extJs4Dir=http-pub/3rdparty/ExtJS/src --label extsdk=http-pub/3rdparty/ExtJS/build/sdk.jsb3 \
http-pub/index.html.template
Error: transforms.registerLabelsAsCustomProtocols: Error initializing resolver: EBADF, Bad file descriptor '/home/kleine/dev/kwk-webapp-skel/http-pub/3rdparty/ExtJS/build/sdk.jsb3'
at Object.openSync (fs.js:221:18)
at Object.readFileSync (fs.js:112:15)
at Object.<anonymous> (/home/kleine/.local/lib/node_modules/assetgraph-builder/lib/resolvers/senchaJsBuilder.js:15:33)
I've recreated the ast_cdr table and reloaded the asterisk module for adaptive ODBC. But still no luck:
CREATE TABLE `ast_cdr` (
`calldate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`uniqueid` varchar(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`clid` varchar(80) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`src` varchar(30) NOT NULL DEFAULT '',
`dst` varchar(30) NOT NULL DEFAULT '',
`dcontext` varchar(50) NOT NULL DEFAULT '',
@kwk
kwk / 0000aaaaa.rst
Created September 2, 2011 14:02
Getting started with webapp-skel

About

With minimal invasion I tried to get up and running with webapp-skel and found this problem:

The website generated for production tries to load ExtJS sources not from the static directory but from 3rdparty/ExtJS/src/app/Application.js (See the file ErrorinChromebrowser below).

The only thing I did was commenting in the app.js file (see index.diff) and adding a simple ExtJS to js/YourApp/app.js (see app.js).

If I add an Ext.require('Ext.Application') at the top of app.js I get this error during make production:

@kwk
kwk / app.js
Created September 6, 2011 10:44
Ext.require("Ext.app.Application");
Ext.application({
name: 'MyApp',
launch: function() {
Ext.create('Ext.container.Viewport', {
items: {
html: 'My App'
}
});
}
// To iterate over all of my stores records (60 in total) and change one column this little snippet takes ~70m.
store.each(function(record) {
record.beginEdit(); // supress any updates to store
record.set("status", 0);
record.endEdit();
return true; // false will abort iteration
});
// When I iterate over only have of the records in my store, the above snippet takes about ~35ms.
@kwk
kwk / check-php-syntax.sh
Created September 16, 2011 10:08
Check PHP-files (added/modified/removed/or unknown) in Mercurial for PHP-Syntax errors
for i in `hg st --no-status $(hg root)`; do mimetype $i | grep php > /dev/null && php -l $i; done
@kwk
kwk / app.js
Created September 21, 2011 15:17
Extract from app.js
// How can I modify my viewport (maybe use a Panel instead?) to render to my <div> ???
var queueMonitorPanel = Ext.create('Ext.Viewport', {
// renderTo : 'queue-monitor-container', // This is the <div> I want to render to
id : 'MyQueueMonitorGrid',
stateId : 'queue_monitor_grid',
layout: {
type: 'border',
padding: 1
},
@kwk
kwk / Makefile
Created September 29, 2011 15:33
Translating JavaScript files
translate:
#
#---------------------------------------------------------------------------
# Extracting new language strings and merging them in to one file
#---------------------------------------------------------------------------
#
cp ${LOCALE_FILE_PATH} ${LOCALE_FILE_PATH_BACKUP}
find ${APP_JS_PATH} ${EXT_JS_PATH}/examples/ux -name "*.js" | xgettext -L C -n -o ${LOCALE_FILE_PATH}.new --files=-
# Merge translations
msgmerge ${LOCALE_FILE_PATH_BACKUP} ${LOCALE_FILE_PATH}.new --output-file=${LOCALE_FILE_PATH}.merged &> /dev/null
@kwk
kwk / JsonRpcModule.php
Created July 9, 2012 14:35
Base class for RPC modules that provides getMethods() functionality.
<?php
/**
* This is the base class for all Json RPC Modules.
*
* @author Konrad Kleine (kwk)
*/
abstract class JsonRpcModule {
/**
* Returns the methods available in the concrete RPC Module implementation.
* All final public methods are returned this way: