This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
import subprocess | |
from bs4 import BeautifulSoup | |
def parse(document): | |
soup = BeautifulSoup(document, 'lxml') | |
return [text for text in soup.stripped_strings if text.startswith("<%= i18n")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env liquidsoap | |
set("harbor.bind_addr", "0.0.0.0") | |
live = input.harbor("/", port=8008, icy=true, buffer=0.0, user="source", password="root") | |
files = mksafe(playlist(mode="normal", "jingle.txt")) | |
radio = fallback(track_sensitive=false, [live,files]) | |
ports = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.loadtest | |
import io.gatling.core.Predef._ | |
import io.gatling.core.controller.inject.InjectionStep | |
import io.gatling.http.Predef._ | |
import scala.concurrent.duration._ | |
sealed trait CommonVars { | |
val nominalResponseTime = Integer.getInteger("nominalResponseTime", 1200).toInt | |
val partDuration = Integer.getInteger("partDuration", 60).toInt seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mappable: | |
def __init__(self, items): self.items = items | |
def map(self, func): | |
return self.__class__(map(func, self.items)) | |
class Filterable: | |
def __init__(self, items): self.items = items | |
def filter(self, func): | |
return self.__class__(filter(func, self.items)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PROJECTS=(%projects%) | |
USER_NAME=root | |
SERVER_PATH=/opt/some-server/ | |
CONNECTIONS=(1 4 16 64 256 1024) | |
BOOTSTRAP='<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">' | |
JS_LIBS='<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>' | |
# clean up working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#Assuming same user name for all hosts | |
USER_NAME='gatling' | |
#Remote hosts list | |
HOSTS=(node1-load.some.host node2-load.some.host node3-load.some.host node4-load.some.host) | |
#Assuming all Gatling installation in same path (with write permissions) | |
GATLING_HOME=/opt/loadtest/ | |
#No need to change this | |
REMOTE_REPORT_DIR=/opt/loadtest/target/gatling/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
AGENT="AudioAddict-di/1.4.7 iOS/8.1" | |
COOKIES="./cookies.txt" | |
AUTH="ephemeron:dayeiph0ne@pp" | |
DOMAIN=gmail.com | |
PLAYLISTDI="di.fm.m3u" | |
PLAYLISTSKY="sky.fm.m3u" | |
PLAYLISTJAZZ="jazzradio.m3u" | |
PLAYLISTROCK="rockradio.m3u" | |
JSONDI="http://listen.di.fm/premium_high.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import unicodedata | |
text = u"Dzień dobry! Wczoraj wysłałem ogłoszenia kolega to mieszkanie. I przypomniałem sobie, " + | |
"że nie przedłużył umowy najmu. Dlatego pytam Pan przygotować nową umowę najmu. " + | |
"Również poprosić o wypłatę przyjechać do dnia 9 lutego, bo Ja idę w podróży służbowej." | |
print unicodedata.normalize('NFD', text).encode('ascii', 'replace') | |
POLISH_CHARACTERS = { |