Skip to content

Instantly share code, notes, and snippets.

View dmfrank's full-sized avatar
🐢
I may be slow to respond.

Dmitry Frank dmfrank

🐢
I may be slow to respond.
View GitHub Profile
@dmfrank
dmfrank / abalone_logit.json
Created January 24, 2017 08:32
request log reg
{
"dataSource": {
"sourceType": "csv",
"fileName": "file:///home/frank_dv/Code/Scala/sparkprototypes/dmfrank/sambatest/src/test/resources/data/logit/abalone/abalone_bin.csv"
},
"modelInfo": {
"modelType": "Logistic",
"responseVariable": {
"name": "LogRings",
"dataType": "String",
@dmfrank
dmfrank / PlayBrowserSpec.scala
Created November 8, 2016 02:15 — forked from sebnozzi/PlayBrowserSpec.scala
How to integrate ScalaTest (FlatSpec) with Play
import org.scalatest.BeforeAndAfterAll
import org.openqa.selenium.WebDriver
import org.openqa.selenium.htmlunit.HtmlUnitDriver
import org.scalatest.FlatSpec
import play.api.test.TestServer
import org.scalatest.Matchers
import play.api.test.Helpers
import org.scalatest.selenium.WebBrowser
import play.api.test.FakeApplication
@dmfrank
dmfrank / FunctionalComposition.scala
Created November 8, 2016 02:15 — forked from sam/FunctionalComposition.scala
Simple example of a Play Framework / ScalaTest spec using functional composition to keep the building of two similar Requests (only difference is the Request-Method) DRY.
"Delete" taggedAs(tag.RolesTag) in {
val request = (FakeRequest(_:String, "/admin/roles/role-bob")) andThen
withAdminCredentials andThen
(route(_:FakeRequest[AnyContentAsEmpty.type]))
for { result <- request(DELETE) } {
status(result) must equal(SEE_OTHER)
flash(result).data must contain key("deleted")
}
@dmfrank
dmfrank / response.xml
Created June 14, 2016 07:23
response on request with Service code
<?xml version="1.0" encoding="utf-8" ?>
<Service_SearchHotel>
<SearchHotel_Response>
<Hotel HotelId="WSMA0911110329" HotelName="Aurum The River Place" Rating="4" Currency="USD" MarketName="Worldwide Market" dtCheckIn="2016-10-14" dtCheckOut="2016-10-15" CancelPolicyId="" InternalCode="CL004-CL002" avail="True">
<RoomCateg Code="WSMA12010955" Name="SUPERIOR ROOM" NetPrice="70.00" GrossPrice="70.00" CommPrice="0.00" Price="70.00" BFType="ABF">
<RoomType TypeName="Twin" NumRooms="2" TotalPrice="70.00" avrNightPrice="70.00" RTGrossPrice="70.00" RTCommPrice="0.00" RTNetPrice="70.00">
<Rate offSet="0" NightPrice="70">
<RoomRate>
<RoomSeq No="1" AdultNum="2" ChildNum="1" ChildAge1="3" ChildAge2="0" RoomPrice="40.00" MinstayPrice="0.00" CompulsoryPrice="0.00" SupplementPrice="0.00" PromotionBFPrice="0.00" EarlyBirdDiscount="5" CommissionPrice="0.00" sRoomType="COA"/>
<RoomSeq No
@dmfrank
dmfrank / request.xml
Created June 14, 2016 07:22
xml request Service code
<Service_SearchHotel>
<AgentLogin>
<AgentId>ZMGH</AgentId>
<LoginName>mghz010</LoginName>
<Password>mghz010</Password>
</AgentLogin>
<SearchHotel_Request>
<PaxPassport>MA05110059</PaxPassport>
<DestCountry>MA05110001</DestCountry>
<DestCity>MA05110041</DestCity>
@dmfrank
dmfrank / vcp.xml
Last active April 1, 2016 08:30
viewCancelPolicy answer
<?xml version="1.0" encoding="utf-8"?>
<Service_ViewCancelPolicy>
<ViewCancelPolicy_Response>
<HotelId>WSMA0511000113</HotelId>
<HotelName>Amari Boulevard</HotelName>
<Policies>
<Policy FromDate="2015-05-29" ToDate="2017-12-30">
<RoomCatgCode Name="DELUXE">WSMA05110034</RoomCatgCode>
<ExCancelDays>7</ExCancelDays>
<ChargeType>Night/Room</ChargeType>
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@dmfrank
dmfrank / bomp.sh
Created February 23, 2016 09:42 — forked from peter-leonov/bomb.sh
docker fork bomb
docker run ruby ruby -e 'loop { fork { fork { sleep 0.1 } } }'
@dmfrank
dmfrank / client.go
Created February 23, 2016 07:32 — forked from jpillora/client.go
Go Yamux Example
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/hashicorp/yamux"
)
@dmfrank
dmfrank / rebuild_goproject.sh
Created February 14, 2016 18:40 — forked from carbocation/gist:5278173
On OS X, use fswatch to automatically recompile your golang project whenever you change a file in the directory.
#!/bin/bash
# This script keeps watch on the current project and compiles it continuously as you change files.
# If there are multiple projects with the same final directory name (e.g., /proj/rad and /lib/monster/rad),
# this will kill any other similarly-named running projects' binaries, potentially leading to havoc.
# To run, install fswatch, drop this file into your project directory, make it executable, and run:
# /usr/local/bin/fswatch ./ ./continuous-compile.sh
echo "Re-compiling"