Skip to content

Instantly share code, notes, and snippets.

View jcleblanc's full-sized avatar

Jonathan LeBlanc jcleblanc

View GitHub Profile
@jcleblanc
jcleblanc / plugin_images.xml
Created December 6, 2011 21:56
plugin.xml file: Images
<!-- Icons used for dropdown and for dropdown menu items -->
<extension point="org.eclipse.ui.commandImages">
<image commandId="com.x.sampleplugin.dropdown.command" icon="icons/home.png"></image>
<image commandId="com.x.sampleplugin.dropdown.commandProfile" icon="icons/profile.png"></image>
<image commandId="com.x.sampleplugin.dropdown.commandLoadSite" icon="icons/site.png"></image>
</extension>
@jcleblanc
jcleblanc / plugin_handlers.xml
Created December 6, 2011 21:56
plugin.xml file: Handlers
<!-- Handlers for each dropdown menu item clicked -->
<extension point="org.eclipse.ui.handlers">
<handler commandId="com.x.sampleplugin.dropdown.command" class="com.x.sampleplugin.handlers.DropDownHandler"></handler>
<handler commandId="com.x.sampleplugin.dropdown.commandProfile" class="com.x.sampleplugin.handlers.DropDownHandler"></handler>
<handler commandId="com.x.sampleplugin.dropdown.commandLoadSite" class="com.x.sampleplugin.handlers.DropDownHandler"></handler>
</extension>
@jcleblanc
jcleblanc / plugin_menus.xml
Created December 6, 2011 21:56
plugin.xml file: Menus
<!-- Dropdown Menu Options -->
<extension point="org.eclipse.ui.menus">
<!-- Toolbar Dropdown Menu -->
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar id="com.x.sampleplugin.dropdown.toolbar">
<command commandId="com.x.sampleplugin.dropdown.command" id="com.x.sampleplugin.dropdown.toolbar.command" style="pulldown"
tooltip="Sample Plugin Menu Options">
</command>
</toolbar>
</menuContribution>
@jcleblanc
jcleblanc / plugin.xml
Created December 6, 2011 18:47
Sample Eclipse Plugin plugin.xml file
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<!-- Toolbar Dropdown Menu -->
<extension point="org.eclipse.ui.commands">
<category id="com.x.sampleplugin.dropdown.category" name="Sample Plugin DropDown"></category>
<command categoryId="com.x.sampleplugin.dropdown.category" id="com.x.sampleplugin.dropdown.command" name="DropDown">
<commandParameter id="com.x.sampleplugin.dropdown.msg" name="DropDown Options" optional="true"></commandParameter>
</command>
<command categoryId="com.x.sampleplugin.dropdown.category" id="com.x.sampleplugin.dropdown.commandProfile" name="Profile">
@jcleblanc
jcleblanc / drupal1_db_config.php
Created December 5, 2011 19:37
Drupal site 1 database configuration
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal1',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'port' => '',
@jcleblanc
jcleblanc / drupal2_db_config.php
Created December 5, 2011 19:36
Drupal site 2 database configuration
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal2',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'port' => '',
@jcleblanc
jcleblanc / flickr_url_generation.php
Created November 29, 2011 21:44
Build Flickr Photo URLs
<?php
$yql_url = 'http://query.yahooapis.com/v1/public/yql?';
$query = 'SELECT * FROM flickr.photos.search WHERE has_geo="true" AND text="san francisco"';
$query_url = $yql_url . 'q=' . urlencode($query) . '&format=xml';
$photos = simplexml_load_file($query_url);
$result = build_photos($photos->results->photo);
echo $result;
function build_photos($photos){
@jcleblanc
jcleblanc / flickr_results.xml
Created November 29, 2011 18:22
flickr.photo.search result set
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="10" yahoo:created="2010-03-31T06:27:19Z" yahoo:lang="en-US" yahoo:updated="2010-03-31T06:27:19Z" yahoo:uri="http://query.yahooapis.com/v1/yql?q=select+*+from+flickr.photos.search+where+has_geo%3D%22true%22+and+text%3D%22san+francisco%22">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-time="444"><![CDATA[http://api.flickr.com/services/rest/?method=flickr.photos.search&has_geo=true&text=san%20francisco&page=1&per_page=10]]></url>
<user-time>445</user-time>
<service-time>444</service-time>
<build-version>5275</build-version>
</diagnostics>
<results>
@jcleblanc
jcleblanc / adjust_height.xml
Created August 28, 2011 23:59
Adjust Height Gadget
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="" width="780" height="400" author = "Nirmal" author_email="[email protected]">
<Require feature="dynamic-height"/>
</ModulePrefs>
<Content type="html" view="home"><![CDATA[
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAbsKUuaQkDlFS5MuhGL6BFhQ-aAVxWC056AEHluvXi7tNMTGv8hTpA_1ngbayPyaiRww7ZFnWC7n2fw"/></script>
<script type="text/javascript">
@jcleblanc
jcleblanc / opensocial_templating.xml
Created July 27, 2011 23:15
OpenSocial Templating and Data Pipelining Gadget
<?xml version="1.0" encoding="utf-8"?>
<Module>
<ModulePrefs title="Reddit Headline Fetch" title_url="http://www.jcleblanc.com" description="Obtains reddit.com headlines via YQL using data pipelining and visualizes using OS templates" author="Jonathan LeBlanc">
<Require feature="opensocial-0.9"/>
<Require feature="opensocial-data" />
<Require feature="opensocial-templates" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/os-data" xmlns:os="http://ns.opensocial.org/2008/markup">