working on it ...

Filters

Explore Public Snippets

Sort by

Found 8,801 snippets matching: plugin

    public by eyemonen  327148  0  4  0

    Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

    Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.: javascript_resources.md
    ## Libraries
    
    - [jQuery](http://jquery.com) - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
    - [Backbone](http://backbonejs.org/) - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
    - [AngularJS](http://angularjs.org/) - Conventions based MVC framework for HTML5 apps.
    - [Underscore](http://underscorejs.org/) - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
    - [lawnchair](http://brian.io/lawnchair/) - Key/value store adapter for indexdb, localStorage and more
    - [Handlebars](http://handlebarsjs.com/) - Minimal semantic templating
    
    ## Plugins
    - [jQueryUI](http://jqueryui.com/) - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.
    - [Bootstrap](http://getbootstrap.com/javascript/) - Bring Bootstrap's components to life with over a dozen custom jQuery plugins. Easily include them all, or one by one.
    - [Async.js](https://github.com/caolan/async) - Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with node.js, it can also be used directly in the browser. Also supports component.
    - [timeago](http://timeago.yarp.com/) - Timeago is a jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
    - [Chosen](https://github.com/harvesthq/chosen) - Chosen is a library for making long, unwieldy select boxes more friendly.
    - [QTip2](http://qtip2.com/) - Second generation of the advanced tooltip plugin for jQuery
    - [spin.js](http://fgnass.github.io/spin.js/) - JS replacement for gif loading spinners
    - [Hotkeys](https://github.com/jeresig/jquery.hotkeys) - John Resig's plugin for adding/removing handlers for keyboard events
    - [Linkify](https://github.com/uudashr/jquery-linkify) - jQuery plugin to format text containing URL or hashtag into clickable anchor tags.
    
    ## Tools
    - [Bower](http://bower.io/) - Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
    - [Grunt](http://gruntjs.com/) - Javascript Task Runner
    
    ## Guides
    - [Jasmine](http://pivotal.github.io/jasmine/) - Jasmine is a behavior-driven development framework for testing JavaScript code.
    - [Building a Chrome Extension](https://developer.chrome.com/extensions/getstarted.html) - Extensions allow you to add functionality to Chrome without diving deeply into native code. You can create new extensions for Chrome with those core technologies that you're already familiar with from web development: HTML, CSS, and JavaScript.
    - [Backbone Tutorials](http://backbonetutorials.com/) - Backbone Tutorials is a collection of tutorials written by Thomas Davis.
    
    

    public by gabriel-shanahan  193873  0  4  0

    Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

    Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.: javascript_resources.md
    ## Libraries
    
    - [jQuery](http://jquery.com) - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
    - [Backbone](http://backbonejs.org/) - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
    - [AngularJS](http://angularjs.org/) - Conventions based MVC framework for HTML5 apps.
    - [Underscore](http://underscorejs.org/) - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
    - [lawnchair](http://brian.io/lawnchair/) - Key/value store adapter for indexdb, localStorage and more
    - [Handlebars](http://handlebarsjs.com/) - Minimal semantic templating
    
    ## Plugins
    - [jQueryUI](http://jqueryui.com/) - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.
    - [Bootstrap](http://getbootstrap.com/javascript/) - Bring Bootstrap's components to life with over a dozen custom jQuery plugins. Easily include them all, or one by one.
    - [Async.js](https://github.com/caolan/async) - Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally designed for use with node.js, it can also be used directly in the browser. Also supports component.
    - [timeago](http://timeago.yarp.com/) - Timeago is a jQuery plugin that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
    - [Chosen](https://github.com/harvesthq/chosen) - Chosen is a library for making long, unwieldy select boxes more friendly.
    - [QTip2](http://qtip2.com/) - Second generation of the advanced tooltip plugin for jQuery
    - [spin.js](http://fgnass.github.io/spin.js/) - JS replacement for gif loading spinners
    - [Hotkeys](https://github.com/jeresig/jquery.hotkeys) - John Resig's plugin for adding/removing handlers for keyboard events
    - [Linkify](https://github.com/uudashr/jquery-linkify) - jQuery plugin to format text containing URL or hashtag into clickable anchor tags.
    
    ## Tools
    - [Bower](http://bower.io/) - Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
    - [Grunt](http://gruntjs.com/) - Javascript Task Runner
    
    ## Guides
    - [Jasmine](http://pivotal.github.io/jasmine/) - Jasmine is a behavior-driven development framework for testing JavaScript code.
    - [Building a Chrome Extension](https://developer.chrome.com/extensions/getstarted.html) - Extensions allow you to add functionality to Chrome without diving deeply into native code. You can create new extensions for Chrome with those core technologies that you're already familiar with from web development: HTML, CSS, and JavaScript.
    - [Backbone Tutorials](http://backbonetutorials.com/) - Backbone Tutorials is a collection of tutorials written by Thomas Davis.
    
    

    public by cghersi  2032  0  6  0

    IntelliJ plugins development: how to implement an action

    Desperately simple!! Just extend AnAction class and implement the actionPerformed method! Moreover, you want to add the existence of this action in your plugin.xml, in the "actions" section:
    public class AboutAction extends AnAction {
    
        private static Logger log = Logger.getLogger(AboutAction.class);
    
        // If you register the action from Java code, this constructor is used to set the menu item name
        // (optionally, you can specify the menu description and an icon to display next to the menu item).
        // You can omit this constructor when registering the action in the plugin.xml file.
        public AboutAction() {
            // Set the menu item name.
            super("About");
            log.debug("about action");
            // Set the menu item name, description and icon.
            // super("Text _Boxes","Item description",IconLoader.getIcon("/Mypackage/icon.png"));
        }
    
        public void actionPerformed(AnActionEvent event) {
            //Create and set up the window.
            AboutView dialog = new AboutView();
            dialog.setVisible(true);
        }
    }

    public by Aysad Kozanoglu  1654  25  3  0

    Cordova Camera Plugin cordova-plugin-camera upload jquery ajax to server request

    Cordova Camera Plugin cordova-plugin-camera upload jquery ajax to server request: cordova-plugin-camera-index.html
    <!DOCTYPE html>
    <!-- Aysad Kozanoglu -->
    <html>
      <head>
        <title>foto cek</title>
    	<style>
    	html {
    		-webkit-user-select: none;
    	}
    	</style>
    	<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
    	<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
        <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    
        <script type="text/javascript" charset="utf-8">
    
        var pictureSource;   // picture source
        var destinationType; // sets the format of returned value
    
        // Wait for device API libraries to load
        //
    		function onLoad() {
    			document.addEventListener("deviceready", onDeviceReady, false);
    		}
    
        // device APIs are available
        //
        function onDeviceReady() {
            pictureSource=navigator.camera.PictureSourceType;
            destinationType=navigator.camera.DestinationType;
    
        }
    
        // Called when a photo is successfully retrieved
        //
        function onPhotoDataSuccess(imageData) {
    		var smallImage = document.getElementById('smallImage');	
    	  
    		smallImage.style.display = 'block';
    		smallImage.src = "data:image/jpeg;base64," + imageData;
    		fotoUpload(imageData);
        }
    
        // A button will call this function
        //
        function capturePhotoEdit() {
          // Take picture using device camera, allow edit, and retrieve image as base64-encoded string
          navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true,
            destinationType: destinationType.DATA_URL });
        }
    
    
        // Called if something bad happens.
        //
        function onFail(message) {
          alert('Failed because: ' + message);
        }
    
        </script>
      </head>
      <body onload="onLoad()">
    	<center>
    	<img src="logo.png" width="50%" border=0>
    	<br>
    	<h1>Entwicklungsumgebung</h1>
    	<br>
    	Kamera Photoschuss und upload Server
    	<br><br><br><br>
    	 <button onclick="capturePhotoEdit();" style="height:60px;width:80%">Photo Schnappschuss</button>
    	 <br><br><br>
    	 <a href="http://5.45.96.121/upload/" target ="_blank"> <h2>Bilder auf dem Server ansehen </h2></a>
    	 <br><br><br>
    	<div id="ajaxStatus"></div>
    	<img style="display:none;width:50%" id="smallImage" src="" />
    	<br><br><font size="-2"> Erfinder: Levent Yakar <br> Architekt: Aysad Kozanoglu
    
    	<script type="text/javascript" charset="utf-8">
          	$(document).ready(function(){
            $("#ajaxStatus").html("ein Bild aufnehmen");
          
          });	
          function fotoUpload(imageData){
          	//alert(imageData);
          	$.ajax({
          		type: "POST",
          		url: "http://5.45.96.121/upload/up2.php",
          		data: { img_data:imageData},
          		cache: false,
          		contentType: "application/x-www-form-urlencoded",
          		success: function (result) {
          			alert("upload OK: "+ result);
          		}
          	});		
          	$("#ajaxStatus").html("bild hochgeladen");
          }
    	</script>
      </body>
    </html>
    
    

    public by gorxguide  9737  0  4  0

    Jekyll Lightbox Image Plugin

    Jekyll Lightbox Image Plugin: lightbox.rb
    # A Liquid tag for Jekyll sites that allows embedding Lightbox images.
    # by: kyoendo
    # Source URL: https://gist.github.com/4035604
    #
    # Example usage: {% lightbox 2012/abc.png, Title of Image, Alt Title %}
    module Jekyll
      class LightboxTag < Liquid::Tag
        def initialize(tag_name, text, token)
          super
          @text = text
        end
    
        def render(context)
          path, title, alt = @text.split(',').map(&:strip)
          %{<a href="/assets/images/#{path}" rel="lightbox" title="#{title}"><img src="/assets/images/#{path}" alt="#{alt || title}" /></a>}
        end
      end
    end
    
    Liquid::Template.register_tag('lightbox', Jekyll::LightboxTag)
    
    

    public by cghersi  2644  1  7  0

    How to retrieve proxy settings within Eclipse

    This class helps to retrieve the proxy settings stored in the preferences of Eclipse. It automatically retrieves such settings using an IProxyService instance provided by the Eclipse RCP platform.
    public class ProxyManager {
    	
    	private final static ServiceTracker<IProxyService, IProxyService> proxyTracker;
    	protected static Logger log = Logger.getLogger(ProxyManager.class);
    	
    	static {
    		proxyTracker = new ServiceTracker<IProxyService, IProxyService>(FrameworkUtil.getBundle(ProxyManager.class).getBundleContext(), 
    				IProxyService.class.getName(), null);
            proxyTracker.open();
    	}
    	
    	private static IProxyService getProxyService() {
            return proxyTracker.getService();
        }
    	
    	public static void setProxy() {
    		IProxyService proxyService = getProxyService();
            IProxyData[] proxyDataForHost = null;
    		try {
    			proxyDataForHost = proxyService.select(new URI(AppConfig.get().getSiteBasePath()));
    		} catch (URISyntaxException e) {
    			log.error("CAnnot find url for proxy service due to " + e, e);
    			return;
    		}
    
    		if (proxyDataForHost != null) {
    	        for (IProxyData data : proxyDataForHost) {
    	            if (data.getHost() != null) {
    	                WebConnector.setProxySettings(data.getHost(), data.getPort());
    	            }
    	        }
    		}
    		
            // Close the service and close the service tracker
            proxyService = null;
    	}
    }

    public by cghersi  2283  0  6  0

    Retrieve the path of a resource inside an Eclipse plugin

    /** * Retrieves the root path for the specified file * @param bundleName name of the bundle containing the file * @param fileName name of the file to search * @return string empty if any error occurred; the full directory path of the specified file otherwise */
    public static String getResourcePath(String bundleName, String fileName) {
    	Bundle bundle = Platform.getBundle(bundleName);
    	URL fileURL = bundle.getEntry(fileName);
    	File file = null;
    	try {
    		URL resolvedUrl = FileLocator.resolve(fileURL);
    		file = new File(resolvedUrl.getFile());
    	} catch (IOException e1) {
    	    e1.printStackTrace();
    	}
    	if (file == null) {
    		System.err.println("Cannot find configuration files");
    		return "";
    	}
    	return file.getParent();
    }

    public by marksimon232  3676  1  6  0

    Track wordpress post views without a plugin using post meta - PHP Snippet

    Use the following snippet to track post views on your wordpress blog. The 
    first thing you want to do is add this snippet to the functions.php of your 
    wordpress theme. Follow step 1. and step 2. to track and display the number
    of views for each post.
    
    FILE - TRACKING.PHP
    
    function getPostViews($postID){
        $count_key = 'post_views_count';
        $count = get_post_meta($postID, $count_key, true);
        if($count==''){
            delete_post_meta($postID, $count_key);
            add_post_meta($postID, $count_key, '0');
            return "0 View";
        }
        return $count.' Views';
    }
    function setPostViews($postID) {
        $count_key = 'post_views_count';
        $count = get_post_meta($postID, $count_key, true);
        if($count==''){
            $count = 0;
            delete_post_meta($postID, $count_key);
            add_post_meta($postID, $count_key, '0');
        } else{
            $count++;
            update_post_meta($postID, $count_key, $count);
        }
    }
    // Remove issues with prefetching adding extra views
    remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
    
    Step 1.
    This part of the tracking views snippet will set the post views. Just
    place this snippet below within the tracking.php inside the wordpress loop.
    
    Snippet: PHP - tracking.php
    <?php
              setPostViews(get_the_ID());
    ?>
    
    Step 2.
    The snippet below is optional, so use this if you would like to display 
    the number of views within your posts. Place this snippet within the loop.
    

    public by number1nub  3160  8  4  0

    Comma Spacing Plugin for AHK Studio

    Comma Spacing Plugin for AHK Studio: Comma Spacing.ahk
    ;menu Spacing - Add Space After Commas
    ;menu Spacing - Remove Spaces Around Commas,Remove
    #SingleInstance, Force
    x:=ComObjActive("AHK-Studio"),sc:=x.sc(),spos:=sc.2008
    if (!sel:=sc.getseltext())
    	sc.2160(sc.2128(line:=sc.2166(sc.2008)),sc.2136(line)),sel:=sc.getseltext()
    store:=[],pos:=0
    while,pos:=RegExMatch(sel,"U)("".*"")",found,pos+1)
    	store[A_Index]:=found1,sel:=SubStr(sel,1,pos-1) "@@_" A_Index "_@@" SubStr(sel,pos+StrLen(found1))
    newTxt:=(%true%="Remove")?RegExReplace(RegExReplace(sel,",\s+",","),"\s+,",","):RegExReplace(sel,",([^,\s])",", $1")
    for c,v in store
    	newTxt:=StrReplace(newTxt,"@@_" A_Index "_@@",v)
    sc.2170(0,newTxt),sc.2397(0),sc.2025(spos)
    ExitApp
    
    

    public by kenrru  3470  2  8  0

    Basic PlugIn Shell for Microsoft Dynamics CRM SDK 2013, 2015

    This snippets provides the basic shell for a Microsoft Dynamics CRM SDK 2013 and 2015 plugin. The shell provides the basic mechanics for the connection, defining the entity image and working with it. You can add additional entity images to this shell as needed.
    #region "Change Log"
    // ======================================================================================================================
    // Function: $FunctionName$    
    // Author: $AuthorName$     
    // Description: $DescriptionText$
    // ----------------------------------------------------------------------------------------------------------------------
    // Change Log
    // 
    // Date of Change   Developer       Description Of Change
    // $ChangeDate$     $AuthorName$    Written
    //
    // ----------------------------------------------------------------------------------------------------------------------
    #endregion
    
    using System;
    using System.ServiceModel;
    using Microsoft.Xrm.Sdk;
    using System.ServiceModel.Description;
    using Microsoft.Xrm.Sdk.Client;
    using Microsoft.Xrm.Sdk.Query;
    using Microsoft.Xrm.Sdk.Discovery;
    using Microsoft.Xrm.Sdk.Deployment;
    using CrmEarlyBound;
    
    namespace $YourNameSpace$
    {
        public class $YourClass$ : IPlugin
        {
            public void Execute(IServiceProvider serviceProvider)
            {
                #region "Obtain the execution context from the service provider"
    
                IPluginExecutionContext context = (IPluginExecutionContext)
                    serviceProvider.GetService(typeof(IPluginExecutionContext));
    
                #endregion
    
                #region "Get Entity Image"
    
                Entity EntityImage;
    
                if (context.MessageName == "$MessageType$")
                {
                    // Use Post Image for Create Messages
    
                    if (context.PreEntityImages.Contains("PreImage") &&
                        context.PreEntityImages["PreImage"] is Entity)
                    {
                        EntityImage = (Entity)context.PreEntityImages["PreImage"];
                    }
                    else
                    {
                        throw new Exception("Image Entity not in Plug-in Context for Update Message");
                    }
                }
                else
                {
                    // Plug in not valid for any other Message Types
    
                    throw new Exception("Plug-in is not valid for the '" + context.MessageName + "' message type");
                }
    
                // Validate the Plugin for Entity $EntitySub$
    
                if (EntityImage.LogicalName != "$EntitySub$")
                {
                    // plug-in is valid for this entity
    
                    throw new Exception("Plug-in is not valid for the '" + EntityImage.LogicalName + "' entity.");
                }
    
                #endregion
    
                #region "Get Organization Service Reference"
    
                IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
                IOrganizationService _service = serviceFactory.CreateOrganizationService(context.UserId);
    
                #endregion
    
                #region "Avoid Infinite Loop"
    
                if (context.Depth > 1)
                {
                    return;
                }
    
                #endregion
                            
                #region "Get EntityImage GUID for $EntitySub$"
    
                if (EntityImage.LogicalName != "$EntitySub$")
                {
                    throw new InvalidPluginExecutionException("Plug-in fired for the wrong Entity");
                }
    
                Guid cid = EntityImage.Id;
    
                #endregion
    
               
    
                #region "Entity Business Logic"
    
                // TODO: Your business logic goes here
    
                #endregion
    
               
                #region "Update Entity Image for $EntitySub$"
    
                try
                {
                   
                    _service.Update(EntityImage);
                    return;
                }
                catch (Exception ex)
                {
                    throw new InvalidPluginExecutionException("Error Updating Record: " + ex.Message);
                }
    
                #endregion
            }
        }                                                
    • Public Snippets
    • Channels Snippets