Skip to content

Instantly share code, notes, and snippets.

View dsample's full-sized avatar

Duncan Sample dsample

View GitHub Profile
@dsample
dsample / android_xml_to_po.rb
Last active December 17, 2015 13:19
A converter from Android's strings.xml to gettext PO format for use with online translation services like PO Editor and Launchpad. Store it in a directory within your Android project. It will output a strings_<locale>.po file. You can store 'context' information (to help translators) in a YAML file with the string names as keys and context descr…
#!/usr/bin/ruby
require 'nokogiri'
require 'fileutils'
require 'yaml'
require 'optparse'
@PROJECT_ID_VERSION = 'ttrscoreboard-android'
@REPORT_MSGID_BUGS_TO = '' # Where to report (A URL or email address)
@dsample
dsample / jaikubackup.php
Created January 1, 2012 14:28
A backup script for Jaiku.
<?php
# Username you want to download the posts for (eg. 'dsample')
$username = '';
# Login information taken from browser cookies - NOT YOUR PLAINTEXT PASSWORD
$jaikuuser = ''; #eg. 'dsample@jaiku.com'
$jaikupassword = ''; #will look random like 'asdfasdfasdfasdfasdfasdfasdfasdf'
# Number of pages of post listings to scrape (0 for all)
CmdUtils.CreateCommand({
name: "mobilecode",
homepage: "http://mobib.org/",
author: { name: "Duncan Sample" },
description: "Shows a mobile code for the current page.",
license: "MPL",
preview: function( pblock ) {
var document = context.focusedWindow.document;
var style = Application.prefs.getValue("mobilebarcode.style", "QR");
var size = Application.prefs.getValue("mobilebarcode.size", "M");
CmdUtils.CreateCommand({
name: "magicious",
takes: {"tags": noun_arb_text},
homepage: "http://www.sample.me.uk/ubiquity/",
author: { name: "Duncan Sample" },
description: "Adds the current page to both Delicious and Magnolia",
help: "To run this you will first need to set the credentials by Ubiq'ing magicious-credentials. Then simply Ubiq magicious with the tags you want to save",
license: "MPL",
preview: function( pblock ) {
var doc = Application.activeWindow.activeTab.document;