Skip to content

Instantly share code, notes, and snippets.

View shankarshastri's full-sized avatar
💻
Think -> Code -> Solve

ShankarShastri shankarshastri

💻
Think -> Code -> Solve
View GitHub Profile
anonymous
anonymous / index.html
Created December 11, 2016 13:37
React Hello World w/ JSBin // source http://jsbin.com/jagegofona
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-0.13.1.js"></script>
<meta charset="utf-8">
<title>React Hello World w/ JSBin</title>
</head>
<body>
<div id="react_example"></div>
<script id="jsbin-javascript">
@johanandren
johanandren / ClusteredRoundRobinPool.scala
Created September 9, 2015 14:30
Simple sample with clustered round robin pool
import akka.actor.{Actor, ActorLogging, ActorSystem, Props}
import akka.cluster.Cluster
import akka.routing.FromConfig
import com.typesafe.config.ConfigFactory
import scala.concurrent.{Await, Future}
import scala.io.StdIn
object ClusteredRoundRobinPool extends App {
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, Props}
import akka.cluster.{Cluster, MemberStatus}
import akka.routing.FromConfig
import com.typesafe.config.ConfigFactory
object ClusterRouting extends App {
class EchoActor extends Actor with ActorLogging {
log.info("Started")
def receive = {
@swsnr
swsnr / ShapelessCaseClassAttributes.scala
Created April 6, 2016 13:40
Get a list of all case class attributes with shapeless
import shapeless._
import shapeless.poly._
import shapeless.record._
import shapeless.ops.record._
import shapeless.ops.hlist.{Mapper,ToTraversable}
import shapeless.tag._
final case class Message(id: Int, title: String, body: String)
trait ToAttributes[T] {
@viktorklang
viktorklang / InterruptibleCancellableFuture.scala
Last active June 1, 2020 13:45
Interruptible-Cancellable-scala.concurrent.Future
/*
Copyright 2018 Viktor Klang
Licensed 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
Unless required by applicable law or agreed to in writing, software
@rklaehn
rklaehn / Client example
Last active June 8, 2020 12:38
akka http file server
package akkahttptest
import akka.http.Http
import akka.stream.ActorFlowMaterializer
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Sink, Source}
import akka.http.model._
object TestClient extends App {
@thesamet
thesamet / ScalaPbSerializer.scala
Last active November 30, 2020 05:50
Akka serializer for ScalaPB messages
package protoser
import java.util.concurrent.atomic.AtomicReference
import akka.actor.ExtendedActorSystem
import akka.serialization.BaseSerializer
import com.trueaccord.scalapb.GeneratedMessageCompanion
class ScalaPbSerializer(val system: ExtendedActorSystem) extends BaseSerializer {
private val classToCompanionMapRef = new AtomicReference[Map[Class[_], GeneratedMessageCompanion[_]]](Map.empty)
@johnpapa
johnpapa / character-detail.component.spec.ts
Last active June 8, 2021 10:27
Angular Input Host/Child Component Test
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Component, NO_ERRORS_SCHEMA, DebugElement } from '@angular/core';
import { By } from '@angular/platform-browser';
import { CharacterDetailComponent } from './character-detail.component';
import { Character, DataService } from '../../core';
import * as testing from '../../../testing';
@Component({
template: '<ro-character-detail [character]="selectedCharacter"></ro-character-detail>'
@domfarolino
domfarolino / EventFlow.md
Last active February 26, 2022 19:14
JavaScript Event Flow - A better understanding

This gist is deprecated and now exists here

This article is intended to further your knowledge of the various phases a DOM event goes through.

Great resources to refer to:

TL;DR

@raviwu
raviwu / notes_soft_skills.md
Last active May 5, 2022 06:43
[Notes] Soft Skills: The software developer's life manual

Page 47

This kind of mindset is crucial to managing your career, because when you start to think of yourself as a business, you start to make good business decisions.

Page 52

Every step you take without a clear direction is a wasted step. Don’t randomly walk through life without a purpose for your career.

Your big goal should be something not too specific, but clear enough that you can know if you’re steering toward it or not. Think about what you want to ultimately do with your career.