Skip to content

Instantly share code, notes, and snippets.

View shekhargulati's full-sized avatar

Shekhar Gulati shekhargulati

View GitHub Profile
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import static adventofcode.Utils.toInt;
import static java.util.stream.Collectors.joining;
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