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 / pricingResCookie.parts.js
Created January 29, 2016 13:30 — forked from mbj/pricingResCookie.parts.js
Why does sixt.de hide they are stealing my history?
// http://www.sixt.de/static/oi/js/pricingResCookie.js | 2012-11-08 21:56 UTC+2
// Loaded when visiting http://www.sixt.de Line 1178.
// Lines: 821-853 with decoded base64 in comments.
// checkHistory() does CSS :visited based history stealing.
// The privacy policy does not reflect they are hitting my privacy with this. Somewhere deeper in the code they are
// checking for: something-even-more-private.com? I dislike such stuff, how far do they want to go?
// German privacy policy under: http://www.sixt.de/informationen/datenschutz/
// I'm not a so happy customer anymore.
var ep = [
@dmfrank
dmfrank / parser.go
Created February 10, 2016 20:41 — forked from eahydra/parser.go
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
)
type RssLayout struct {
@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"
@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 / 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 } } }'
// 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 / 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>
@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 / 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 / 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")
}