Skip to content

Instantly share code, notes, and snippets.

@bigbeno37
bigbeno37 / Greeter.ts
Created June 11, 2017 01:58
How to get multiple files working with typescript
import {Student} from "./Student";
function greeter(student: Student) {
return student.firstName + " " + student.lastName;
}
let user = new Student("Jane", "Doe");
document.body.innerHTML = greeter(user);
@bigbeno37
bigbeno37 / compile.sh
Created July 21, 2017 01:47
Multiple C files
gcc main.c utils.c -o runMe
@bigbeno37
bigbeno37 / index.d.ts
Created September 7, 2018 08:25
electron dl typings
declare module ElectronDL {
interface ElectronDLOptions {
/**
* Show a 'Save As...' dialog instead of downloading immediately. Note: Only use this option
* when strictly necessary. Downloading directly without a prompt is a much better user experience.
*
* Defaults to false
*/
saveAs: boolean;
@bigbeno37
bigbeno37 / script.js
Last active September 29, 2018 10:30
ELO Points
// Calculates the log base 'base' of 'value' e.g. logBase(2, 4) is log_2 (4) = 2
function logBase(base, value) {
return log(value)/log(base);
}
/*
* Calculates the points earned after winning a match based on the following:
* Min and max points: The minimum and maximum amount of points to be applied
* Min and max delta: At what rank difference the min or max points should be applied (e.g. -500 and 500 ranking point difference)
* Delta: How much ranking point difference there is between the two players (winningPlayer - losingPlayer)
@bigbeno37
bigbeno37 / .gitlab-ci.yml
Created August 9, 2019 14:07
Gitlab auto deploy
image: node:lts
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$VPS_KEY")
- mkdir -p ~/.ssh
cache:
paths:
- node_modules/