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 DrawFuelBars(surface): | |
# Draw player 1's fuel bar | |
x1 = 100 # FIXME: update to starting x location | |
y1 = 100 # FIXME: update to starting y location | |
x2 = x + player1_fuel | |
y2 = y + 10 | |
color = (255, 255, 255) # TODO: add code to change the fuel bar's color based on fuel amount | |
pygame.draw.rect(surface, color, (x1, y1, x2, y2)) |
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 BryanKaelin < Man | |
attr_accessor :time_paradox | |
def initialize(name, body, time_paradox) | |
@time_paradox = time_paradox | |
super | |
end | |
def create_offspring(name) | |
Man.new(name, @body + @time_paradox) |
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 React, { Component } from 'react' | |
import { withRouter } from 'react-router' | |
import { connect } from 'react-redux' | |
import { projectSelector } from 'selectors/projects' | |
import { userSelector } from 'selectors/users' | |
import { fetchProjectsRequest } from 'actions/projects' | |
import { fetchUsersRequest } from 'actions/users' | |
import { Project } from 'components/projects' | |
class ProjectContainer extends Component { |
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
val elements = mutableListOf<Int>() | |
Flux.just(1, 2, 3, 4) | |
.log() | |
.subscribe(elements::add) |
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
val elements = mutableListOf<Int>() | |
Flux.just(1, 2, 3, 4) | |
.log() | |
.subscribe({ elements.add(it) }) |
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
val elements = mutableListOf<Int>() | |
Flux.just(1, 2, 3, 4) | |
.log() | |
.subscribe({ elements.add(it) }) |
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
@Component | |
class UriDecryptionFilter : ZuulFilter() { | |
override fun run() = null | |
override fun shouldFilter() = false | |
override fun filterOrder() = 1 | |
override fun filterType() = "pre" | |
} |
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 UriDecryptionFilterTest { | |
private val filter = UriDecryptionFilter() | |
private val request = MockHttpServletRequest() | |
@Before | |
fun init() { | |
val ctx = RequestContext.getCurrentContext() | |
ctx.clear() | |
ctx.request = request | |
} |
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
@Test | |
fun `basic properties`() { | |
assertEquals(false, filter.shouldFilter()) | |
assertEquals(1, filter.filterOrder()) | |
assertEquals("pre", filter.filterType()) | |
} |
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
@Test | |
fun `should filter if encrypted string found in uri`() { | |
val encrypted = "ABCDEFG123456" | |
request.requestURI = "/endpoint/$encrypted" | |
assertEquals(true, filter.shouldFilter()) | |
} |
OlderNewer