Skip to content

Instantly share code, notes, and snippets.

View nils-werner's full-sized avatar

Nils Werner nils-werner

View GitHub Profile
@nils-werner
nils-werner / packageinfo.json
Created July 7, 2011 10:35
How to bundle node.js services with webOS apps

It's fairly easy to bundle a service with any webOS apps. All you have to do is:

  1. Create three directories in your current webOS app directory. Name them anything you like but I'd recommend application, package and service

  2. Move all original app files into application

  3. Copy and modify the basic FileIO service from https://gist.github.com/1014188 into service Change the services.json file to refer to your Service ID. The Service ID has to be a subdomain of your App ID.

@nils-werner
nils-werner / bob.sql
Created June 21, 2011 14:16
SQLite queries to enable BOB on WebOS 1.4.5
insert into com_palm_data_carriernetworksettings_CarrierNetworkSettings ("mcc", "mnc", "qOperatorShortName", "useThisOverrideRecord", "maxTransitUnit", "maxSegmentSize", "maxSocketIdleTime", "qOperatorLongName", "gsmNumSimPDP", "umtsNumSimPDP", "smsEmailGateway", "smsMessageSizeLimit", "isSmscNumberOnSimCard", "smscNumber", "smsValidityPeriod", "smsMaxPartsPerMessage", "smsMaxRecipients", "smsRequestDeliveryReceiptAvailable", "smsCanSendBlank", "smsHeaderSizeLimit", "smsEncoding", "smsTransportMethods", "smsNumberSecondsWaitForSegment", "useVodaphoneVoicemail", "voicemailNumber", "useGpsSettingsInCarrierDb", "gpsAllowed", "msBasedAllowed", "msAssistedAllowed", "agpsServerAddr", "msAllowedApps", "msfpTimerMin", "msfpTimerMax", "msfpTimerDefault", "msfpTimerInterval", "mmsApnId", "mmscWapGateway", "mmscUrl", "mmscPortNumber", "mmscMessageSizeLimit", "mmsMaxVideoSize", "mmsDefaultPageDuration", "mmsMaxAudioSize", "mmsMaxPictureHeight", "mmsMaxPictureWidth", "mmsMaxRecipients", "mmsProxy", "mmsAckMessageRead", "m
@nils-werner
nils-werner / ReadDirAssistant.js
Created June 8, 2011 10:44
Simple FileIO Service for WebOS
var ReadDirAssistant = function() {
}
ReadDirAssistant.prototype.run = function(future) {
var fs = IMPORTS.require("fs");
var path = this.controller.args.path;
fs.readdir(path, function(err, files) { future.result = { path: path, files: files }; });
}
@nils-werner
nils-werner / Crontab entry
Created April 29, 2011 09:20
Periodic MySQL dumper
0 * * * * /home/nils/Server/mysql/backup.sh
@nils-werner
nils-werner / Makefile
Created April 29, 2011 09:07
Makefile for Palm SDK
#
# Makefile for Palm WebOS SDK
#
# By default, this Makefile installs and launches apps on the Emulator. To override this
# behaviour override the variable DEVICE to be "usb". i.e. make reinstall DEVICE=usb
#
PACKAGE = com.yourdomain.yourapp
DEVICE = tcp
LEVEL = info
@nils-werner
nils-werner / clone
Created April 13, 2011 11:46
Clone a repo, replace the origin remote and initialize all submodules
#!/bin/bash
cd $(pwd)
git clone $1 .
git submodule update --init
git remote rm origin
git remote add upstream $1
git remote add origin $2
#
# Put this file in any of the directories of your PATH (try echo $PATH to see them)
#
<![CDATA
dies ist ein Test
]]>
Hallo
<p>
Testparagraph
</p>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsl">
<xsl:template name="rbga-to-hex">
<xsl:param name="rgba-val"/>
<xsl:param name="count" select="1"/>
<xsl:variable name="val" select="substring-before($rgba-val,',')"/>
<xsl:variable name="tail" select="substring-after($rgba-val,concat($val,','))"/>
@nils-werner
nils-werner / e
Created December 14, 2010 17:07
Some simple shellscripts for launching my texteditor and a git GUI
#!/bin/bash
if [ $# = 0 ]; then
killall gedit &> /dev/null
/usr/bin/gedit "$(pwd)/$(ls -1p | grep -v \/$ | head -n 1)" &> /dev/null &
else
/usr/bin/gedit "$@" &> /dev/null &
fi
@nils-werner
nils-werner / gist:721650
Created November 30, 2010 13:10
URL encode/decode
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
ISO-8859-1 based URL-encoding demo
Written by Mike J. Brown, [email protected].
Updated 2002-05-20.
No license; use freely, but credit me if reproducing in print.