Skip to content

Instantly share code, notes, and snippets.

View Martin1982's full-sized avatar
🤓
Solving problems

Martin de Keijzer Martin1982

🤓
Solving problems
View GitHub Profile
@Martin1982
Martin1982 / TiMapGenymotion.md
Created June 17, 2014 13:15
Using Ti.Map in Genymotion

Using the Android Ti.Map module in Genymotion

When working on a new Titanium project I came across a requirement which involved using maps on iOS and Android. Since Google has changed the way the API keys work I couldn't rely on the V1 method which I used in the past. Luckily Titanium provides the [ti.map] add-on module with [perfect documentation] on how to set it up for the V2 API keys.

Note: doublecheck if this module isn't already installed in the documented directory, in my case it was already present.

When I was ready to run my code and booted up my Genymotion emulator I got the following error:

@Martin1982
Martin1982 / provision.sh
Last active August 29, 2015 14:00
Shell Provisioner for Vagrant with Ansible on Windows Hosts
#!/usr/bin/env bash
# Assumes apt is available and has a source with the Ansible package
sudo apt-get update
sudo apt-get install ansible -y
# hosts file with only the text '127.0.0.1', change path accordingly
# required because Windows makes files executable by default which Ansible doesn't like
sudo cp /vagrant/provisioning/hosts /tmp
chmod 666 /tmp/hosts
@Martin1982
Martin1982 / config.xml
Created March 1, 2013 12:17
Set the Android API level for PhoneGap build to only build for Jelly Bean
<!-- Android specific settings -->
<preference name="android-minSdkVersion" value="16" />
<preference name="android-maxSdkVersion" value="17" />
@Martin1982
Martin1982 / config.xml
Created March 1, 2013 12:14
PhoneGap build config to hide the splashscreen spinner
<!-- iOS specific settings -->
<preference name="show-splash-screen-spinner" value="false" />
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.hello-world"
version = "2.2.0">
<name>Hello World</name>
<description>
Hello World sample application that responds to the deviceready event.
</description>
@Martin1982
Martin1982 / deploy.sh
Created November 6, 2012 13:32
Sencha Touch 2 deployment script
#!/bin/bash
# Web deploy
echo "Deploying the application web package"
rm -rf ../build/www
~/Applications/SenchaSDKTools-2.0.0-beta3/sencha app build -e production -d ../build/www -a ../archive
# PhoneGap build deploy
echo "Deploying the application Phonegap Build package"
rm -f ../build/pgbuild/package.zip
@Martin1982
Martin1982 / uastring.php
Created August 16, 2012 07:47
A little script to utilize the http://useragentstring.com API
<?php
// Test script for detecting the OS by user agent string
// uses the API from http://www.useragentstring.com
// Do not forget to add caching! Continuously hitting the
// API is bad for performance of both the API and your
// application.
$apiParams = array(
'uas' => $_SERVER['HTTP_USER_AGENT'],
'getJSON' => 'os_name'
@Martin1982
Martin1982 / run-myemu.sh
Created July 25, 2012 22:08
A boot file for the Boot 2 Gecko emulator with loads of logging
#!/bin/bash
B2G_HOME=$PWD
. load-config.sh
DEVICE=${DEVICE:-generic}
TOOLS_PATH=$B2G_HOME/out/host/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/bin
DBG_CMD=""
@Martin1982
Martin1982 / nested-arrays.php
Created March 12, 2012 19:28
Nested arrays
<?php
$shop = array(
'electronics' => array(
'stereo set',
'speakers'
'tv'
),
'software' => array(
'games',
'office',
@Martin1982
Martin1982 / associative-arrays.php
Created March 12, 2012 19:27
Associative arrays
<?php
$categories = array(
'first' => 'my first category',
'second' => 'new category',
'third' => 'etc...'
)
// Show the second category
echo "The second category is " . $categories['second'];
?>