Skip to content

Instantly share code, notes, and snippets.

View RobinRadic's full-sized avatar

Robin Radic RobinRadic

View GitHub Profile
/**
Usage:
- Ensure the following mods are installed and enabled: ModTools - BetterBulldozeTool
- Startup game, open asset editor, load a intersection
- Press ctrl+q to open ModTools
- Ensure all 4 options are checked (use console, hook, etc)
- Open de Debug Console (F7)
- Copy/paste the code between // # START ... and // # STOP ...
- Press run.
@RobinRadic
RobinRadic / thijs.sh
Created January 30, 2016 14:34
thijs
#!/usr/bin/env bash
MY_VAR1="SEBwite"
MY_VAR2="ThijsSebwite"
cat >> .outputfile << EOF
VARNAME1=${MY_VAR1}
VARNAME2=${MY_VAR2}
EOF
<?php
class ProjectNotFoundException extends \Exception
{
public static function missingConfig()
{
return new static("Could not find the project config file");
}
FROM ubuntu:14.04
CMD echo "This is a test" | wc -
#
# bash_functions
#
#
# load autosys functions
#
. ~/.bash/.bash_autosys_functions
#
#
# bash_aliases
#
alias reload='. $HOME/.bash_profile'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
export class InputHelper {
@lazyInject('cli.config')
protected config: Config
async ask(question: string, def?: string): Promise<string> {
return <Promise<string>> new Promise((resolve, reject) => {
inquirer.prompt({ name: 'ask', default: def, type: 'input', message: question })
.then(answers => resolve(answers.ask))
export function Mixin<T>(...mixins: Array<new (...args: any[]) => any>): new (...args: any[]) => T {
return mixins.reduceRight((prev, cur) => __extends(cur, prev), class {});
}
function __extends(f: MixinFunction, s: MixinFunction): MixinFunction {
const mixedClass = class {
constructor() {
return f.apply(s.apply(this, arguments) || this, arguments);
}
@RobinRadic
RobinRadic / almost-working-mixin.ts
Created October 25, 2017 11:50
can assign constructor parameters to mixins as well
import 'reflect-metadata'
import * as assert from 'assert';
import { action, computed, observable } from 'mobx';
function Mixin<T>(...mixins): new(mixinsParameters?: { [key: string]: any }) => T {
// let current = mixins.length - 1;
class X {
constructor(mixinsParameters?: { [key: string]: any }) {
@RobinRadic
RobinRadic / test-mixins.ts
Created October 25, 2017 11:55
try merging mobx stuff
import 'reflect-metadata'
import * as assert from 'assert';
import { action, computed, observable } from 'mobx';
function Mixin<T>(...mixins): new(mixinsParameters?: { [key: string]: any }) => T {
// let current = mixins.length - 1;
class X {
constructor(mixinsParameters?: { [key: string]: any }) {