Skip to content

Instantly share code, notes, and snippets.

View shekhargulati's full-sized avatar

Shekhar Gulati shekhargulati

View GitHub Profile
package playground
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import playground.Parent.{BulkTasks, Finish, TaskCompleted, TaskFailed}
import scala.util.{Failure, Success, Try}
trait Task {
val id: String
@shekhargulati
shekhargulati / SlidingString.java
Last active October 17, 2015 07:51
Java 8 String Sliding Example. Given a String "abcdef" the program should print >> a ab abc abcd abcde abcdef
import java.util.stream.IntStream;
/**
* Given a String "abcdef" the program should print
* a
* ab
* abc
* abcd
* abcde
* abcdef
<rule name="yakCiRule" scope="deployed">
<conditions>
<type>udm.BaseDeployed</type>
<operation>CREATE</operation>
</conditions>
<steps>
<complex-step>
<ci>
<rules-test.Yak id="Infrastructure/tmp/yak007">
</rules-test.Yak>
<rule name="yakCiRule" scope="deployed">
<conditions>
<type>udm.BaseDeployed</type>
<operation>CREATE</operation>
</conditions>
<steps>
<complex-step>
<ci>
<rules-test.Yak id="Infrastructure/tmp/yak007">
</rules-test.Yak>
{
"category": "Deploy",
"provider": "XL-Deploy",
"version": "32",
"settings": {
"entityUrlTemplate": "{Config:XL Deploy URL}",
"executionUrlTemplate": "{Config:XL Deploy URL}"
},
"configurationProperties": [
{
{
"category": "Deploy",
"provider": "XL-Deploy",
"version": "1",
"settings": {
"entityUrlTemplate": "{Config:XL Deploy URL}",
"executionUrlTemplate": "{Config:XL Deploy URL}"
},
"configurationProperties": [
{
@shekhargulati
shekhargulati / ReactiveCollatzConjectureSequence
Last active August 29, 2015 14:20
Reactive Collatz Conjecture Sequence
import rx.Observable;
import rx.Subscriber;
import java.util.stream.IntStream;
public class CollatzConjectureSequence {
public static void main(String[] args) {
Observable<Integer> observable = CollatzConjectureSequence.create(19);
@Entity
public class Profile extends BaseEntity {
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile", cascade = CascadeType.ALL, orphanRemoval = true)
private List<SocialConnection> socialConnections = new ArrayList<>();
@NotBlank
@Column(unique = true)
@Email

datamaps is also delivered as a jQuery/Zepto plugin, as shown in this example (in addition to a Backbone view).

datamaps will add datamap to an existing version of jQuery if it's on the page. Otherwise, if there is no jQuery/Zepto, it will add a global copy of Zepto for you to use.

Add a container div to the page and select with jQuery/Zepto and call the datamap function. Pass customization options to datamap.

This example shows a custom popup function (any JS templating language that compiles to a function like _.templates and handlebars).

The custom template has two model objects

@shekhargulati
shekhargulati / server.xml
Created July 9, 2013 09:23
Tomcat 8 server.xml required to deploy on OpenShift
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0