Skip to content

Instantly share code, notes, and snippets.

View selcukusta's full-sized avatar

Selçuk Usta selcukusta

View GitHub Profile
Feature: BDD-Python-Sample
Scenario: First Python scenario
Given StringHelper sinifindan kopya olusturacagim
When RemoveDiacritics metoduna parametre olarak "Merhaba Dünya Ben Maraşlı" ve "True" gececegim
Then Sonuc "merhaba dunya ben marasli" seklinde olmali
open FSharp.Data
open XPlot.GoogleCharts
let wikiUrl = "https://en.wikipedia.org/wiki/All-time_table_of_the_FIFA_World_Cup"
type FifaProvider = HtmlProvider<"https://en.wikipedia.org/wiki/All-time_table_of_the_FIFA_World_Cup">
let fifaWiki = FifaProvider.Load(wikiUrl)
let source =
(
[| for row in fifaWiki.Tables.``All-time table``.Rows ->
row.``Name of Team``, row.Pld, row.GF |]
|> Array.map(fun(name, numberOfMatches, goalsFor) ->
let teamName = System.Text.RegularExpressions.Regex.Replace(name, "\[\d+\]", "")
teamName, goalsFor, numberOfMatches)
|> Array.sortByDescending(fun(name, goals, matches) -> (goals))
)
let options =
Options(
colorAxis = ColorAxis(colors = [|"yellow"; "red"|])
)
source
|> Chart.Geo
|> Chart.WithOptions options
|> Chart.WithLabels ["Goal Count"; "Match Count"]
|> Chart.Show
# Marker to tell the VCL compiler that this VCL has been adapted to the
# new 4.0 format.
vcl 4.0;
# Default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "8080";
}
docker pull python:latest
docker run --name python -v C:/python-scripts:/etc/scripts -p 1905:1905 -it python:latest /bin/bash
--name python # container bundan sonra "python" ismiyle çağrılacak
-v C:/python-scripts:/etc/scripts # container içerisindeki /etc/scripts klasörü lokal bilgisayarımdaki C:/python-scripts klasörü ile eşlenecek. Böylece lokal bilgisayarımda bu klasörde yapılan bir değişiklik otomatik olarak container'a da yansıyacak.
-p 1905:1905 # container'ın 1905 portu ile lokal bilgisayarımın 1905 portu eşleniyor.
-it python:latest /bin/bash # bu container "python:latest" olarak indirilen image'ı kullanacak ve container shell komutları çalıştırılabilir (interaktif) olarak aktif olacak.
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Docker container'da yaşayan bir garip Tornado uygulaması...")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
docker pull ubuntu:latest
docker run -p 6081:6081 --link python:tornado-app -v C:/Varnish:/etc/varnish/ -it ubuntu:latest /bin/bash