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
[{ | |
$match: | |
{ | |
_id: { | |
$gte: ObjectId('6459e25142d1fa00071e3b72') | |
} | |
} | |
}] |
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
# Start a new mysql 5.7 DB at host port 3306 | |
docker run --name=mysql57 -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 -d mysql/mysql-server:5.7 | |
# Connect to docker container | |
docker exec -it mysql57 mysql -p | |
# Create superuser | |
create user looi@'%' identified by 'password'; | |
grant all on *.* to looi@'%'; | |
flush privileges; | |
# Start a new mysql 5.7 DB at host port 3307 |
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
### Keybase proof | |
I hereby claim: | |
* I am davelooi on github. | |
* I am davidlooi (https://keybase.io/davidlooi) on keybase. | |
* I have a public key whose fingerprint is 1E92 D6E2 97BA C062 CEEB 97C1 A8F9 DF38 5BF9 81A8 | |
To claim this, I am signing this object: |
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
# frozen_string_literal: true | |
module CoverageMerger | |
def self.merge(directories:) | |
require 'json' | |
require 'simplecov' | |
# Simplecov generates a report on exit by default | |
# We are doing this manually with merged resultsets | |
SimpleCov.at_exit {} |
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
## somewhere.rb | |
bunch_of_user_entities = UserRepository.new.fetch_all_active_users.map do |user_record| | |
UserEntity.new(user_record.id, user_record.email, user_record.name, user_record.age) | |
end | |
## user_entity.rb | |
class UserEntity < Struct.new(:id, :email, :name, :age) | |
def to_s |
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
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script> | |
</head> | |
<body> | |
<canvas id="myChart"></canvas> | |
</body> |
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
puts "Ryan Gosling" |
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
begin; | |
create table users (id integer, name text); | |
create table segments (id integer, name text); | |
create table user_segment (user_id integer, segment_id integer); | |
insert into users (id, name) values (1, 'david'); | |
insert into users (id, name) values (2, 'davido'); | |
insert into users (id, name) values (3, 'looi'); | |
insert into users (id, name) values (4, 'oliver'); |
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
<html> | |
<head> | |
<script> | |
function numberOfDice() { | |
return document.getElementById("numberOfDice").value; | |
} | |
function handleDiceChange() { | |
document.getElementById('rangeValLabel').innerHTML = numberOfDice(); | |
} | |
function rollDice() { |
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 DavidBot < RTanque::Bot::Brain | |
NAME = 'david_bot' | |
include RTanque::Bot::BrainHelper | |
def tick! | |
## main logic goes here | |
# use self.sensors to detect things | |
# See http://rubydoc.info/github/awilliams/RTanque/master/RTanque/Bot/Sensors | |