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 | |
# selenium - this script starts and stops the selenium grid | |
# | |
# chkconfig: - 85 15 | |
# description: Selenium Grid is a distributed testing platform for browser-based automation. | |
# processname: selenium | |
# pidfile: /etc/selenium/tmp/selenium.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions |
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
<?php | |
namespace XXX\Tests\Document; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
abstract class AbstractTest extends WebTestCase | |
{ | |
static $container; |
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 math import radians, cos, sin, asin, sqrt, atan2, degrees | |
def _c(old): | |
direction = {'N':1, 'S':-1, 'E': 1, 'W':-1} | |
new = old | |
new = new.split() | |
new_dir = new.pop(0) | |
new.extend([0,0,0]) | |
x = (float(new[0])+float(new[1])/60.0+float(new[2])/3600.0) * direction[new_dir] | |
return x |
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
import random | |
summary = {"lose_inital":0, "win_initial":0, "lose":0, "win":0} | |
def game(switch=False): | |
fields = [False,False,False] | |
winField = random.randint(0,2) | |
fields[winField] = True | |
setField = random.randint(0,2) | |
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
def externalPaymentAttributes(): | |
return { | |
'country': 'CH', | |
'email': self.host_emails[0] if self.host_emails else None, | |
'business_name': self.name, | |
#'business_tax_id_provided': False, | |
'tos_acceptance': { | |
'date': int(time.time()), | |
'ip': "185.90.38.128", | |
'user_agent': 'Cathedra Backend' |
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
import random | |
import math | |
teamof = 2 | |
def teams(people): | |
teams = [] | |
for i in range(len(people) / teamof): | |
team = [] | |
for i in range(teamof): | |
p = random.choice(people) |
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 hypchat import HypChat | |
import re | |
import sys | |
import argparse | |
import select | |
from hypchat.requests import HttpClientError | |
parser = argparse.ArgumentParser(description='Simply sends a message to a given room') | |
parser.add_argument('-t', '--token', action='store', dest="apitoken", default='xxxxxx') | |
parser.add_argument('-r', '--room', action='store', dest="room", default='rnd') |
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
<?php | |
class X { | |
public $name; | |
public function __construct($name) { | |
$this->name = $name; | |
} | |
# This must be defined in order to have array_diff() working | |
#public function __toString() { | |
# return $this->name; |
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
<?php | |
function base64url_encode($data) { | |
return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
} | |
// payload | |
$data = array("username"=>"John"); | |
$data_json = json_encode($data); | |
$dataz = gzcompress($data_json); | |
if(strlen($dataz) < (strlen($data_json) - 1)) |
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/python | |
import time | |
import threading | |
import Queue | |
import random | |
class BaseSynchronisation(object): | |
num_threads = 5 | |
threads = None |
OlderNewer