Skip to content

Instantly share code, notes, and snippets.

View amolbrid's full-sized avatar

Amol Brid amolbrid

View GitHub Profile
package com.squarespace.hamster.rabbitmq.v6;
import com.squarespace.hamster.runtime.client.Context;
import com.squarespace.hamster.runtime.client.Job;
import com.squarespace.hamster.runtime.client.serialization.Serde;
import com.squarespace.v6.model.trashcan.queue.TrashcanDeletionMessage;
public class TestRabbitConsumerJob implements Job<TrashcanDeletionMessage, TrashcanDeletionMessage> {
private V6MessageSerde<TrashcanDeletionMessage, TrashcanDeletionMessage> serde;
CategoryID,CategoryName,IABCategory
1,Arts & Entertainment,IAB1
2,Books & Literature,IAB1-1
3,Celebrity Fan/Gossip,IAB1-2
4,Fine Art,IAB1-3
5,Humor,IAB1-4
6,Movies,IAB1-5
7,Music,IAB1-6
8,Television,IAB1-7
9,Automotive,IAB2
@amolbrid
amolbrid / ArrayComposeTest.java
Last active November 18, 2016 18:16
ArrayCompose with constant
String json = "{\"name\":\"abc\", \"active\":false}";
StartFunction start = new StartFunction();
ConstantFunction constFun1 = new ConstantFunction(JsonNodeFactory.instance.textNode("const1"));
ConstantFunction constFun2 = new ConstantFunction(JsonNodeFactory.instance.textNode("const1"));
ReadPropertyFunction read = new ReadPropertyFunction("name");
ReadPropertyFunction readActive = new ReadPropertyFunction("active");
EqualsFunction eql = new EqualsFunction("true");
ArrayComposeFunction arrayCompose = new ArrayComposeFunction();
PrintFunction print = new PrintFunction();
@amolbrid
amolbrid / gist:735ed7bb5f9a8f820d27b4db58ad26e4
Created November 18, 2016 16:43
List of branches to delete
origin/Adapter-dfp
origin/Add_Pending
origin/Ads-controller-core
origin/CON-338_1
origin/CW-1017
origin/CW-1034
origin/CW-1036
origin/CW-1159
origin/CW-1170
origin/CW-1451
@amolbrid
amolbrid / SessionTest.java
Created October 13, 2016 17:12
Beeswax session issue
package com.collective.buzz.buzz_it;
import static com.collective.ittests.helpers.IntegrationTestHelper.dateTimeAsString;
import com.collective.pint.adapter.buzz.api.BuzzPartnerServiceLookup;
import com.collective.pint.core.dto.PlatformBasicAuthInfo;
import com.collective.pint.core.dto.PlatformInfo;
import com.collective.pint.core.models.Advertiser;
import com.collective.pint.core.services.AdvertiserPartnerService;
import org.junit.Test;
987889384,981859166,981143928,911117141,824321468,727364962,665075115,641641246,566563944,493274942,454376900,437588725,437579638,408264345,406376063,972013240,960637533,900517816,741684888,972358336,978810802,969154564,920869470,900411275,896514116,892277940,698082806,627396565,414667075,496033448,955957721,385511356,963689934,903751102,662083128,954011418,404721929,836071680,967976403,933623806,881342787,979874157,975475272,515303474,976511945,964746895,967422975,967055808,950274807,316793974,969435065,970892126,375099832,852801667,872579324,962018978,909480609,584878141,606413051,409644287,637030094,594494009,672828590,937620952,714109929,542203931,958979148,434847893,469397482,469396327,469738478,512317806,525811534,545642993,566359326,600019252,600023563,505509351,505244949,505978863,505554182,506060763,467460140,488539168,488237027,333188676,345874448,487296004,404244684,904391631,552637004,530157928,600072714,408263139,367893195,815248536,408263295,814555930,408265227,505507641,924636125,673376074,3936
@amolbrid
amolbrid / cat.json
Created May 3, 2016 16:29
trade desk categories
{
"Result": [
{
"CategoryId": 54,
"ParentCategoryId": null,
"Name": "Arts & Entertainment",
"Path": "Arts & Entertainment",
"Children": [
{
"CategoryId": 55,
pathPrefix("advertisers") {
pathEnd {
get {
onSuccess(advertisersService.list) { advs ⇒
complete(advs)
}
} ~
post {
entity(as[JObject]) { jObject ⇒
val advertiser = jObject.extract[Advertiser]
package com.example.test
import scala.slick.driver.PostgresDriver
object UserComponentRegistry extends UserRepositoryComponent {
val userRepository = new UserRepository(PostgresDriver)
}
@amolbrid
amolbrid / authmanager.scala
Created February 23, 2015 17:44
Authentication with DI
class AuthenticationManager {
// inject db: Database, repo: Users
def authenticateWithToken(token: String): Option[User] = {
db withTransaction { implicit session =>
repo.authenticateWithToken(token)
}
}
}
trait TokenAuthenticator {