Skip to content

Instantly share code, notes, and snippets.

Avatar

Boguste Hameyie bhameyie

View GitHub Profile
@bhameyie
bhameyie / SourceCodeGenerator.scala
Last active Jul 1, 2020
Only generate tables for a single schema
View SourceCodeGenerator.scala
import slick.codegen.SourceCodeGenerator
import slick.jdbc.JdbcProfile
import slick.model.Model
import scala.concurrent.{Await, ExecutionContext}
import scala.concurrent.duration.Duration
object SourceCodeGenerator {
@bhameyie
bhameyie / halFormBuilder.js
Created May 1, 2017
Rendering HAL Extension
View halFormBuilder.js
function buildForm(containerId,obj) {
if (!obj["_presentable"]) {
return;
}
var presentable = obj["_presentable"];
var links = obj["_links"];
var form = document.createElement("form");
@bhameyie
bhameyie / All.cs
Created May 1, 2017
Sample description of HAL extension idea
View All.cs
public enum LinkKind
{
Fetch,
Save,
Update
}
public enum Restrictions
{
Required,
@bhameyie
bhameyie / haproxy.cfg
Last active Sep 13, 2020
Sample haproxy config
View haproxy.cfg
##based on Mesosphere Marathon's servicerouter.py haproxy config
global
daemon
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
tune.ssl.default-dh-param 2048
defaults
@bhameyie
bhameyie / cloudform.template.json
Last active Aug 29, 2015
cheapo dcos template test (do not use in production!!!!)
View cloudform.template.json
{"Metadata":{"DcosImageCommit":"fb58e5c0a02fe44e8df2baf92de72bea3030f34b","TemplateGenerationDate":"2015-06-05 23:02:57.870011"},"Description":"Launching the Mesosphere DCOS cluster","Parameters":{"AcceptEULA":{"Type":"String","Description":"Please read and agree to our EULA: https://docs.mesosphere.com/community-edition-eula/","AllowedValues":["Yes"]},"KeyName":{"Type":"AWS::EC2::KeyPair::KeyName","Description":"Name of SSH key to link"},"PublicSlaveInstanceCount":{"Type":"Number","Description":"Number of public slave nodes to launch","Default":"1"},"SlaveInstanceCount":{"Type":"Number","Description":"Number of slave nodes to launch","Default":"5"},"AdminLocation":{"MinLength":"9","AllowedPattern":"^([0-9]+\\.){3}[0-9]+\\/[0-9]+$","ConstraintDescription":"must be a valid CIDR.","Type":"String","Description":"The IP range to whitelist for admin access.","Default":"0.0.0.0/0","MaxLength":"18"}},"Mappings":{"NATAmi":{"eu-central-1":{"default":"ami-204c7a3d"},"eu-west-1":{"default":"ami-3760b040"},"ap-southeast-
@bhameyie
bhameyie / Client.scala
Last active Aug 29, 2015
Vanilla Akka Cluster
View Client.scala
object Main {
def main(args: Array[String]): Unit = {
val systemName = "47Ronin"
val system = ActorSystem(systemName)
val mediator = DistributedPubSubExtension(system).mediator
mediator ! Publish(Channels.printingChannel,
PrintIt("print it I say")) // to send to all
mediator ! Send(Channels.printingChannel,
PrintIt("print it I say")) // to send to a single printer dude
}
@bhameyie
bhameyie / Client.scala
Created Feb 6, 2015
Akka Remoting Pitfall
View Client.scala
object Main {
def main(args: Array[String]): Unit = {
val addr= "akka.tcp://47Ronin@servermachine:9551/user/printerDude"
val system = ActorSystem()
val printerDude = system.actorSelection(addr)
printerDude ! PrintIt("still printing")
}
}
@bhameyie
bhameyie / Main.scala
Created Feb 6, 2015
Vanilla Akka usage
View Main.scala
object Main {
def main(args: Array[String]): Unit = {
val systemName = "47Ronin"
val system = ActorSystem(systemName)
val printer = system.actorOf(Props[PrinterDude], "printerDude")
printer ! PrintIt("Hello World!")
}
}
@bhameyie
bhameyie / run.sh
Created Jan 16, 2015
running terraform
View run.sh
terraform get
terraform plan -out terraform.tfplan
View gist:22688d3d6f1c4d2333bd
provider "aws" {
access_key = "${var.aws_accesskey}"
secret_key = "${var.aws_secretkey}"
region = "us-east-1"
}
module "appsvr1" {
source = "../app_servers"
region = "us-east-1"
memory = "t2.small"
You can’t perform that action at this time.