Skip to content

Instantly share code, notes, and snippets.

@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/
@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 / 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 / compile.sh
Created July 21, 2017 01:47
Multiple C files
gcc main.c utils.c -o runMe
@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 / install_LIDEH.sh
Last active February 13, 2017 01:21
Install Laravel IDE Helper
echo -e "\x1B[01;95mWhere was your Laravel project installed? (Use a full path such as /home/ubuntu/projects/blog/)\x1B[0m"
read PATH
cd $PATH
echo -e "\x1B[01;95mHas Laravel IDE Helper been installed? (Y/n)\x1B[0m"
read INSTALLED
if [ $INSTALLED = "n" ] || [ $INSTALLED = "N" ]; then
echo -e "\x1B[01;93mInstalling...\x1B[0m"
composer require barryvdh/laravel-ide-helper
echo -e "\x1B[01;93mAdd this to providers array in app.php in config\x1B[0m"
echo -e "\x1B[01;93mBarryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class\x1B[0m"
@bigbeno37
bigbeno37 / install-laravel.sh
Last active November 20, 2021 11:14
Install Laravel 5.4, MySQL 5.7, Apache2.4 and PHP7.1 on Ubuntu 16.04
# CREATED BY BEN O'SULLIVAN / BIGBENO37 (GITHUB.COM/BIGBENO37)
# LICENSED UNDER CREATIVE COMMONS 'Attribution 4.0 International' LICENSE
# https://creativecommons.org/licenses/by/4.0/
# FEEL FREE TO USE AND ADAPT THIS SCRIPT IN COMMERCIAL AND NON COMMERICAL PRODUCTS
# AS LONG AS PROPER ACCREDITATION IS GIVEN
# VARIABLES
echo -e "\x1B[01;95mWhat would you like to name your Laravel project?\x1B[0m"
read LARAVEL_PROJECT_NAME
vagrant init unbuntu/xenial64
cd #location/of/.box
vagrant box add ubuntu/xenial64 #nameof.box
@bigbeno37
bigbeno37 / .gitignore
Created July 27, 2016 09:38
Unity gitignore
# =============== #
# Unity generated #
# =============== #
Temp/
Obj/
UnityGenerated/
Library/
Assets/AssetStoreTools*
Test_Data/
layout title date categories
post
Introduction to Gulp Boilerplate!
2016-02-24 10:27:02 +1100
gulp jade stylus preprocessor workflow