Skip to content

Instantly share code, notes, and snippets.

View 17cupsofcoffee's full-sized avatar

Joe Clay 17cupsofcoffee

View GitHub Profile

Configuring OERealm Authentication for REST Services

Setting Up The Pacific Application Server

The following steps only have to be carried out once per PASOE instance - however, the settings used will be required whenever you are configuring a new REST project, so keep note of them.

  • In <OpenEdge Work Folder>/<Server Name>/conf/jvm.properties, add or modify the following setting:
-Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false
  • Open a Proenv command prompt as administrator and run cd <OpenEdge Work Folder>/<Server Name>/common/lib.
  • Generate a Client-Principal file using the genspacp.bat utility - this will be used to secure the HybridRealm class from being called by other PASOE clients.
open Akka.FSharp
open Akka.Actor
let system = System.create "system" (Configuration.defaultConfig())
type GreeterMsg =
| Hello of string
| Goodbye of string
let greeter = spawn system "greeter" <| fun mailbox ->
open System.Net
open Akka.FSharp
open Akka.IO
open Akka.Actor
let system = System.create "system" (Configuration.defaultConfig())
type GreeterMsg =
| Hello of string
| Goodbye of string
open System.Net
open Akka.FSharp
open Akka.IO
open Akka.Actor
let system = System.create "system" (Configuration.defaultConfig())
type GreeterMsg =
| Hello of string
| Goodbye of string
open System.Net
open System.Text
open Akka
open Akka.FSharp
open Akka.IO
open Akka.Actor
let system = System.create "system" (Configuration.defaultConfig())
type GreeterMsg =
@17cupsofcoffee
17cupsofcoffee / Cargo.toml
Last active March 2, 2019 17:33
main and lib in the same crate
[package]
name = "example"
version = "0.1.0"
authors = ["Joe Clay <27cupsofcoffee@gmail.com>"]
edition = "2018"
[dependencies]
pub struct VecGrid<T> {
data: Vec<T>,
width: usize,
height: usize,
}
impl<T> VecGrid<T> {
pub fn new(width: usize, height: usize) -> VecGrid<T> {
VecGrid {
data: Vec::with_capacity(width * height),
@17cupsofcoffee
17cupsofcoffee / anim_state.rs
Created September 17, 2019 17:41
Splitting animation state from the texture in Tetra
use tetra::graphics::Rectangle;
#[derive(Debug, Clone)]
pub struct AnimationState {
frames: Vec<Rectangle>,
frame_length: i32,
current_frame: usize,
timer: i32,
}
@17cupsofcoffee
17cupsofcoffee / README.md
Created December 9, 2019 21:56
Pooling sound effects in Tetra

Here's a quick example of how you can pool instances of a sound effect in Tetra! There's a few advantages to doing this:

  • You cap the number of identical sounds that can play at once, which avoids you accidentally calling play in a loop and blowing out your speakers (not speaking from experience, honest 😅).
  • It gives you a central place to apply variations to the sound - e.g. you could make it so the pitch gets set to a slightly randomized value each time.
  • It's probably slightly more performant than spawning new SoundInstances every time (as always, avoid premature optimization).
use ggez::{event, graphics, nalgebra, Context, GameResult};
struct MainState {
spritebatch: graphics::spritebatch::SpriteBatch,
}
impl MainState {
fn new(ctx: &mut Context) -> GameResult<MainState> {
let width: f32 = 128.0;
let height: f32 = 128.0;