This file contains hidden or 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
module Invocing | |
module Queries | |
class FindClientInvoiceByOrder | |
dependency :client_invoice_dao, ClientInvoice | |
def call(order_id) | |
ClientInvoice.includes(:line_items).find_by(order_id: order_id) |
This file contains hidden or 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 | |
set -eo | |
exit 0 | |
echo "Logging in..." | |
code-push login --accessKey $CODEPUSH_ACCESS_KEY |
This file contains hidden or 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
export default class Main extends Component { | |
// currentUser stuff is in the state... | |
render() { | |
const AppNavigator = createRootNavigator(); | |
return ( | |
<SessionContext.Provider value={this.state}> |
This file contains hidden or 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
{ | |
rules: [ | |
{ | |
pattern: '/db/migrations/.*', | |
items: [ | |
'Have you verified x', | |
'Have you verified y' | |
] | |
} | |
] |
This file contains hidden or 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
module Values | |
module Support | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
# Defines a new value_attribute |
This file contains hidden or 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
public class Exercise { | |
public static void main(String[] args) { | |
Node root = new Node(10); | |
// I have no idea if this code works, would be sensible to write a unit test | |
// this would be easy to do by using the comparable interface, ie build the desired tree | |
// then simply compare them | |
root.addValue(15); |
This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
public class ArrayIterator implements Iterator<T> { | |
// Set local variables | |
private T[][] array2D; | |
private int pos = 0; // The position of our cursor |
This file contains hidden or 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
module SomeDomain | |
class SomeProcess < Service | |
dependency :find_user, Users::Queries::FindByEmail | |
dependency :save_user, Users::Commands::Save | |
def call(email, some_argument) | |
user = find_user.(email) | |
if user.some_thing?(some_argument) |
This file contains hidden or 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
module Pets | |
class Dog | |
def bark | |
raise 'Calling the abstract pet' | |
end | |
end | |
This file contains hidden or 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
module DependencySupport | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
# Substitutes a give dependency with a provided value | |
# will raise an exception if a provided dependency is missing | |
# @param [Sumbol] dependency_name | |
# @param [*] value |