Skip to content

Instantly share code, notes, and snippets.

View hartsock's full-sized avatar

Shawn Hartsock hartsock

View GitHub Profile
@hartsock
hartsock / InstallLocalPlugins.groovy
Created August 19, 2010 13:27
Installs plugin zip files found in a Grails apps' base directory.
/**
* install in your application's 'scripts' directory.
* <p/>
* invoke: $ grails install-local-plugins
* <p/>
* @author Shawn Hartsock <hartsock@acm.org>
*/
includeTargets << grailsScript("Init")
includeTargets << grailsScript("_PluginDependencies")
@hartsock
hartsock / extract_error_codes.gsp
Created September 9, 2010 20:54
Extracts the error codes on a page and prints them so you can use them in your messages.properties
<g:each var="error" in="${myInstance.errors}">
<g:each var="codes" in="${error?.fieldErrors?.codes}">
<g:each var="code" in="${codes}">
<div>${code}</div>
</g:each>
</g:each>
</g:each>
@hartsock
hartsock / ProfilerFilters.groovy
Created January 3, 2011 21:26
An example filter for use with the Grails Profiler plugin that will profile *every* request
class ProfilerFilters {
def profilerLog
def filters = {
allUri(uri:'/**') {
before = {
if(Environment.getCurrent().equals(Environment.DEVELOPMENT) && System.getProperty('grails.profiler.on')) {
profilerLog.startProfiling("grails.profiler")
}
}
@hartsock
hartsock / gist:817414
Created February 8, 2011 22:30
titanium developer trace 2011/02/08
[22:27:45:791] [Titanium.Network.HTTPClient] [Debug] Changing readyState from 0 to 1 for url:https://api.appcelerator.net/p/v1/app-track
[22:27:45:792] [Titanium.Proxy] [Debug] Looking up proxy information for: https://api.appcelerator.net/p/v1/app-track
*** Unable to locate valid config! Falling back to auto-detection...
*** Unable to locate PAC! Falling back to direct...
[22:27:45:792] [Titanium.Proxy] [Debug] Using direct connection.
[22:27:45:806] [Titanium.File] [Debug] ToString: /home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py
[22:27:45:806] [Titanium.API] [Information] (JavaScript.KKJSList) [ "/home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py", "emulator", ""Groosfaba"", ""/home/shartsock/tools/android"", ""/home/shartsock/projects/TitaniumProjects/Groosfaba"", ""groosfaba"", ""1"", ""HVGA"", ]
** Message: console message: file:///home/shartsock/.titanium/modules/linux/tiui/1.0.0/ui.js @139: /home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py,emulator,"
@hartsock
hartsock / gist:817420
Created February 8, 2011 22:32
titanium developer trace 2011/02/08 full trace
[22:27:45:791] [Titanium.Network.HTTPClient] [Debug] Changing readyState from 0 to 1 for url:https://api.appcelerator.net/p/v1/app-track
[22:27:45:792] [Titanium.Proxy] [Debug] Looking up proxy information for: https://api.appcelerator.net/p/v1/app-track
*** Unable to locate valid config! Falling back to auto-detection...
*** Unable to locate PAC! Falling back to direct...
[22:27:45:792] [Titanium.Proxy] [Debug] Using direct connection.
[22:27:45:806] [Titanium.File] [Debug] ToString: /home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py
[22:27:45:806] [Titanium.API] [Information] (JavaScript.KKJSList) [ "/home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py", "emulator", ""Groosfaba"", ""/home/shartsock/tools/android"", ""/home/shartsock/projects/TitaniumProjects/Groosfaba"", ""groosfaba"", ""1"", ""HVGA"", ]
** Message: console message: file:///home/shartsock/.titanium/modules/linux/tiui/1.0.0/ui.js @139: /home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py,emulator,"
@hartsock
hartsock / gist:817429
Created February 8, 2011 22:37
titanium developer mobile_sdk trace 2011/02/08 with forced rebuild
shartsock@osil005:~/tools/appcelerator/Titanium Developer-1.2.2$
shartsock@osil005:~/tools/appcelerator/Titanium Developer-1.2.2$ ./Titanium\ Developer --trace
[22:34:58:077] [Titanium.Host] [Information] Loaded module = api
[22:34:58:087] [Titanium.Host] [Information] Loaded module = javascript
[22:34:58:089] [Titanium.Host] [Information] Loaded module = tiapp
[22:34:58:089] [Titanium.Host] [Information] Loaded module = tifilesystem
[22:34:58:090] [Titanium.Host] [Information] Loaded module = tiplatform
[22:34:58:093] [Titanium.Host] [Information] Loaded module = tiui
[22:34:58:094] [Titanium.Host] [Error] Could not load module (/home/shartsock/.titanium/modules/linux/python/1.0.0/libpythonmodule.so): "Error loading module (/home/shartsock/.titanium/modules/linux/python/1.0.0/libpythonmodule.so): libpython2.5.so.1.0: cannot open shared object file: No such file or directory
@hartsock
hartsock / gist:817438
Created February 8, 2011 22:39
titanium developer trace from inside developer window 2011/02/08
[INFO] Launching Android emulator...one moment
[DEBUG] From: /home/shartsock/tools/android/tools/emulator
[DEBUG] SDCard: /home/shartsock/.titanium/android2.sdcard
[DEBUG] AVD ID: 1
[DEBUG] AVD Skin: HVGA
[DEBUG] SDK: /home/shartsock/tools/android
[INFO] Emulator is running.
[INFO] Building Groosfaba for Android ... one moment
[INFO] Titanium SDK version: 1.6.0 (02/07/11 19:30 49c5b13...)
[DEBUG] Waiting for device to be ready ...
@hartsock
hartsock / gist:819167
Created February 9, 2011 20:07
Titanium Developer Trace 2011/02/09 after using same Android SDK to push an application to phone
[INFO] Launching Android emulator...one moment
[INFO] Creating new Android Virtual Device (loading... loading...)
[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR] File "/home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py", line 1622, in <module>
[ERROR] s.run_emulator(avd_id, avd_skin)
[ERROR] File "/home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py", line 348, in run_emulator
[ERROR] avd_name = self.create_avd(avd_id,avd_skin)
[ERROR] File "/home/shartsock/.titanium/mobilesdk/linux/1.6.0/android/builder.py", line 318, in create_avd
[ERROR] inifilec = open(inifile,'r').read()
@hartsock
hartsock / gist:819183
Created February 9, 2011 20:12
./build/android/gen/com/groosfaba/R.java
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.groosfaba;
public final class R {
@hartsock
hartsock / gist:819222
Created February 9, 2011 20:33
Titanium Developer trace 2011/02/09 on new project with new tiapp.xml (different values)
1. delete old project
2. create fresh project
3. Emulator now launches
4. get new trace...
[INFO] Launching Android emulator...one moment
[INFO] Building com.example.test.Groosfabas for Android ... one moment
[INFO] Titanium SDK version: 1.6.0 (02/07/11 19:30 49c5b13...)
[INFO] Waiting for the Android Emulator to become available
[ERROR] Timed out waiting for android.process.acore
[INFO] Copying project resources..