Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nikhilv
nikhilv / LICENSE.md
Last active October 27, 2015 10:07 — forked from davefp/LICENSE.md
Weather Widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 David Underwood

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@nikhilv
nikhilv / OpenStackProvisionTest.java
Created January 16, 2015 21:42
really rough junit system test
package ecplugins.openstack;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openstack4j.api.OSClient;
import org.openstack4j.model.compute.Keypair;
import org.openstack4j.model.compute.Server;
import org.openstack4j.openstack.OSFactory;
import java.io.BufferedReader;
@nikhilv
nikhilv / ElectricCommander.rb
Last active August 29, 2015 14:01
May 2014 hackathon, commander + dashing
require 'uri'
require 'net/http'
require 'net/https'
require 'json'
class ElectricCommander
$sessionId = ""
def initialize(server, port,format,debug)
# Instance variables
@nikhilv
nikhilv / gist:6106856
Created July 29, 2013 19:08
Gist for Vagrant issue 1983
INFO global: Vagrant version: 1.2.2
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/init/plugin.rb
INFO manager: Registered plugin: init command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/package/plugin.rb
@Override public Widget doInit()
{
final VerticalPanel verticalPanel = new VerticalPanel();
ExpandStringRequest expandStringRequest = this.getRequestFactory().createExpandStringRequest();
expandStringRequest.setValue("$[/javascript var list = myUser.projectList; (!(typeof(list)===\"undefined\")) ? list : getProperty(\"/projects/PluginGlobals/projectList\");]");
expandStringRequest.setCallback(new CommanderObjectCallback() {
@Override
public void handleResponse(CommanderObject commanderObject) {
verticalPanel.add(new Label(commanderObject.get("value")));
@nikhilv
nikhilv / gist:5269156
Last active December 15, 2015 13:39
gist for ask.electric-cloud.com question about jsni and accessing javascript from an ElectricCommander GWT plugin.
// In your javascript file
var sayHello = function(){
alert("Hello World!");
}
// In your <Component>.java file
import com.google.gwt.core.client.JavaScriptObject;
public native JavaScriptObject callNative() /*-{
$wnd.sayHello();
}-*/;
@nikhilv
nikhilv / getResourcesJson.pl
Created October 26, 2012 15:42
Demonstrates how to parse json output from the ElectricCommander server
# Copyright (c) 2012 Nikhil Vaze
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE