Skip to content

Instantly share code, notes, and snippets.

@nikhilv
nikhilv / LICENSE.md
Last active Oct 27, 2015 — forked from davefp/LICENSE.md
Weather Widget for Dashing
View LICENSE.md

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 Jan 16, 2015
really rough junit system test
View OpenStackProvisionTest.java
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 Aug 29, 2015
May 2014 hackathon, commander + dashing
View ElectricCommander.rb
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 Jul 29, 2013
Gist for Vagrant issue 1983
View gist:6106856
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
View gist:5463956
@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 Dec 15, 2015
gist for ask.electric-cloud.com question about jsni and accessing javascript from an ElectricCommander GWT plugin.
View gist:5269156
// 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 Oct 26, 2012
Demonstrates how to parse json output from the ElectricCommander server
View getResourcesJson.pl
# 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