Skip to content

Instantly share code, notes, and snippets.

@patricksevat
patricksevat / component-object-base.ts
Created Nov 20, 2019
base class for Component Object
View component-object-base.ts
// ./objects/base/component-object-base.ts
export abstract class ComponentObjectBase {
componentName: string;
element: string;
elementToRender: string;
render = async () => {
if (!this.element || !this.elementToRender) {
throw new Error('please define an element and elementToRender to check if the feature was rendered');
}
@openpanzer
openpanzer / openpanzer-save.json
Created Nov 20, 2019
Tutorial - Battle of Minorca-1
View openpanzer-save.json
{"scenario":{"name":"Tutorial - Battle of Minorca","maxTurns":20,"date":"1939-02-04T06:00:00.000Z","atmosferic":0,"latitude":0,"ground":0,"turnsPerDay":6,"dayTurn":0,"reinforcements":{"6":[{"row":13,"col":4,"unit":{"eqid":142,"id":-1,"owner":0,"hasMoved":false,"hasFired":false,"hasResupplied":false,"hasOverstrength":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":2,"flag":8,"destroyed":false,"player":null,"transport":null,"carrier":0,"moveLeft":5,"ammo":14,"fuel":47,"hasAnimation":false,"hits":0,"experience":50,"entrenchment":0,"entrenchTicks":0,"leader":-1},"turn":6,"id":1},{"row":14,"col":15,"unit":{"eqid":173,"id":-1,"owner":0,"hasMoved":false,"hasFired":false,"hasResupplied":false,"hasOverstrength":false,"isMounted":false,"isSurprised":false,"isDeployed":false,"isCore":false,"tempSpotted":false,"strength":10,"facing":14,"flag":8,"destroyed":false,"player":null,"transport":null,"carrier":0,"moveLeft":16,"ammo":4,"fuel":120,"hasAnimati
@SalahHamza
SalahHamza / ID.js
Created Nov 20, 2019 — forked from gordonbrander/ID.js
ID - a unique ID/name generator for JavaScript
View ID.js
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
@InnoDataFaster
InnoDataFaster / PY0101EN-4-1-ReadFile.ipynb
Created Nov 20, 2019
Created on Cognitive Class Labs
View PY0101EN-4-1-ReadFile.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jin0x
jin0x / functions.php
Created Nov 20, 2019 — forked from CrispDev/functions.php
Autoship Customization // Toggle an Orders Autoship Scheduled Items based on Shipping Address in Checkout
View functions.php
/**
* Checks if the supplied address is a valid autoship address.
* @param array $address
*/
function xx_autoship_valid_shipping_address( $address ){
// Add Any Address Checks to filter here ( i.e. valid city, state, zip, country )
return apply_filters( 'xx_autoship_valid_shipping_address', 'US' == $address['shipping_country'], $address );
View hello_world.py
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created Nov 20, 2019
Rimworld output log published using HugsLib
View output_log.txt
This file has been truncated, but you can view the full file.
Log uploaded on Wednesday, November 20, 2019, 3:07:56 PM
Loaded mods:
ModCheck: 0Harmony(1.2.0.1), ModCheck(1.8.1.0)
Core: (no assemblies)
Startup impact: 0Harmony(1.2.0.1), StartupImpact(1.1.7027.12912)
HugsLib[ov:6.1.3]: 0Harmony(1.2.0.1), HugsLib(av:1.0.0.0,fv:6.1.3)
JecsTools: 0Harmony(1.0.9.1), 0JecsTools(1.0.8.0), AbilityUser(1.18.0.0), AbilityUserAI(1.18.0.0), CompActivatableEffect(1.18.0.0), CompAnimated(1.18.0.0), CompBalloon(1.18.0.0), CompDeflector(1.18.0.0), CompDelayedSpawner(1.18.0.0), CompExtraSounds(1.18.0.0), CompInstalledPart(1.18.0.0), CompLumbering(1.18.0.0), CompOverlays(1.18.0.0), CompOversizedWeapon(1.18.0.0), CompSlotLoadable(1.18.0.0), CompToggleDef(1.18.0.0), CompVehicle(1.17.0.1), PawnShields(1.0.0.0), ThinkNodes(1.0.0.0)
RuntimeGC: RuntimeGC(20.0.15.1)
Mod Manager: 0ColourPicker(2.0.0.22137), 0Harmony(1.2.0.1), FluffyUI(1.0.0.22965), ModManager(av:1.0.0.0,fv:1.31.872), YamlDotNet(av:6.0.0.0,fv:6.1.2.0)
View untrusted-lvl1-solution.js
/*****************
* cellBlockA.js *
*****************
*
* Good morning, Dr. Eval.
*
* It wasn't easy, but I've managed to get your computer down
* to you. This system might be unfamiliar, but the underlying
* code is still JavaScript. Just like we predicted.
*
@patricksevat
patricksevat / page-object-base.ts
Created Nov 20, 2019
base class for Page Object
View page-object-base.ts
// ./objects/base/page-object-base.ts
export abstract class PageObjectBase {
element: string;
features: IComponentObject[];
url: string;
async waitUntilRendered(): Promise<any> {
try {
await this.verifyRenderRequirements();
You can’t perform that action at this time.