Skip to content

Instantly share code, notes, and snippets.

View dmateos's full-sized avatar

Daniel Mateos dmateos

View GitHub Profile
<?
class DomainVariable {
private $domain;
function __construct($domain = null) {
if($domain == null) {
$this->domain = DomainVariable::get_domain();
} else {
$this->domain $domain;
}
class DomainVariable {
private $domain;
function __construct($domain = null) {
if($domain == null) {
$this->domain = DomainVariable::get_domain();
} else {
$this->domain $domain;
}
}
ID=1
for i in {1..10000}
do
NUM=$(( ( RANDOM % 10 ) + 1 ));
LOAD=$(cut -d ' ' -f 1 < /proc/loadavg)
curl -H "Content-Type: application/json" -X POST -d "{\"id\": $ID, \"data_sequence\" : { \"data\":\"12839083,$LOAD\"} }" http://localhost:3000/api/v1/data_sequences
sleep 0.5
done
<? [15/18]
class MailDomainGrabber {
private $email;
private $excludes = array(
"yahoo.com.au",
"yahoo.com",
"yahoo.co.uk",
"tpg.com.au",
"telstra.com",
"sa.gov.au",
<?
class CUAJobSegmenter {
private $jobs;
function __construct($jobs) {
$this->jobs = $jobs;
}
function get_segments_of($number) {
$segment_array = array();
1 BasicGame.ServerHandler = function(game, player) {
2 this.players = {};
3 this.entities = [];
4 this.uuid = "";
5 this.player = player;
6 this.game = game;
7 self = this;
8 }
9
10 BasicGame.ServerHandler.prototype = {
1 BasicGame.ServerHandler = function(game, player) {
2 this.players = {};
3 this.entities = [];
4 this.uuid = "";
5 this.player = player;
6 this.game = game;
7 self = this;
8 }
9
10 BasicGame.ServerHandler.prototype = {
@dmateos
dmateos / file.rb
Last active February 13, 2016 13:16
module GoTipping
class DomainGenerator
def initialize(name, domain, potential_conflicts = Setting.all, finder = SettingsFinderQuery.new)
@name = name
@domain = domain
@potential_conflicts = potential_conflicts
@finder = finder
end
def generate
module GoTipping
class UserAuthenticator
def initialize(username, organisation)
@user = organisation.users.find_by(username: username)
end
def authenticate(password)
return false unless @user
if BCrypt::Password.new(@user.password_digest) == password
FROM ruby:2.2.0
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y nodejs
RUN apt-get install -y libmysqld-dev
ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME