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
// Basically just a typed facade around PubSub, but the basic goal | |
// is the same regardless of the backing implmentation | |
export default class MessageBridge<MessageMap> | |
{ | |
// ... snip | |
public subscribe<MessageName extends keyof MessageMap>( | |
messageName : MessageName, | |
listener : (message : MessageMap[MessageName]) => void |
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
// factory included just to be silly | |
class ApiClientFactory | |
{ | |
options; | |
defaultOptions = { | |
"apiClientClass" : "ApiClientPrecheck", | |
"clientOptions" : { | |
"tokenLife" : 400, | |
"someDeepConfig" : { | |
"foo" : 10, |
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
// yeaaaah | |
#include "includes/streamfx.effect" | |
uniform float minPass< | |
string name = "Minimum alpha to let through"; | |
string field_type = "slider"; | |
float minimum = 0.0; | |
float maximum = 1.0; | |
float step = 0.001; |
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
<?php | |
interface IThingy | |
{ | |
function getClassifier() : string; | |
} | |
class DynamicMethodHost | |
{ | |
private string $methodPrefix = "__handle"; |
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
using System.Collections.Generic; | |
using Zenject; | |
using SMG.EventBus.Interfaces; | |
using SMG.Proximity.Players; | |
namespace SMG.Proximity.GameFlow | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Unity.UIElements.Runtime; | |
using UnityEngine.UIElements; | |
using Zenject; | |
using SMG.Common.Exceptions; | |
/// <summary> |
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
polerin [12:08 PM] | |
Well, lets discuss something. I'm not saying I'm right y'all. Just that I have... opinions. | |
heh | |
OK, so the general subject is this: Immutability/static behavior in OOP | |
As I mentioned in #ideabin, I find it frustrating when objects change state through method calls that don't seem like they should do that. | |
it introduces a lot of variability and potential for unexpected behavior. | |
polerin [12:10 PM] | |
So I feel like there are two general categories of classes/objects in what I'd consider a well structured OO environment. | |
Data containment/manipulation objects, and command/functional objects. |
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
// Copy the below and use it to create a bookmarklet, or paste it into the developer console for the page. | |
// This should be used after the video is playing. | |
(function() { | |
var playerFrame = document.getElementsByTagName("iframe")[0]; | |
console.log("changing size of iframe:", playerFrame); | |
playerFrame.style.width = "100%"; | |
playerFrame.style.height = "100%"; | |
console.log("changing max width of container"); |
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
/** | |
* New pattern, pseudo-enum. | |
* Benefits: | |
* - no magic strings! | |
* - possible IDE completion | |
* - easier to track down what values are allowable (explicit list location) | |
* - better self documenting (container naming describes the intent of the field) | |
* - easy to inspect the object and see valid states in dev tools | |
* - possibly better on memory? Need to check references |
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
namespace Blah { | |
public class RoundManager { | |
// ... // | |
/// <summary> | |
/// Load up the right round inspector and , activate the appropriate bins and dispensers. | |
/// </summary> | |
protected async void StartRound(RoundStartEvent StartEvent) | |
{ |
NewerOlder