Skip to content

Instantly share code, notes, and snippets.

View divanvisagie's full-sized avatar
🦀
Rewriting it in Rust

Divan Visagie divanvisagie

🦀
Rewriting it in Rust
View GitHub Profile
@divanvisagie
divanvisagie / settings.json
Created May 4, 2020 11:55
VSCode settings
{
"workbench.colorTheme": "Nord",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.checkProjectSettingsExclusions": false,
"files.autoSave": "afterDelay",
"extensions.ignoreRecommendations": false,
"amVim.bindCtrlCommands": false,
"workbench.settings.editor": "json",
"workbench.editorAssociations": [
@divanvisagie
divanvisagie / UseBranchForPort.cs
Created October 18, 2019 06:30
C# Kestrel pipeline branch
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Hosting.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace Swerve
{
public static class ApplicationBuilderExtensions
@divanvisagie
divanvisagie / InstallMounteBank.ps1
Created September 24, 2019 08:56
Powershell Script To Install Mountebank
Write-Host "Mountebank Installer"
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "This setup needs admin permissions. Please run this file as admin."
break
}
### Version Check
if (Get-Command node -ErrorAction SilentlyContinue) {
{
"ext": "ts",
"exec": "npm start"
}
import {expect} from 'chai'
describe('When we run tests', () => {
it('Should actually work' , () => {
expect(true).to.be.eq(true)
})
}
@divanvisagie
divanvisagie / index.ts
Last active January 2, 2019 08:58
Express TypeScript example
import express, {Express} from 'express'
const port: number = 3000
const app: Express = express()
app.get('/', (req, res) => {
res.json({message: 'Hello World'})
})
app.listen(port, () => {
@divanvisagie
divanvisagie / color_cheater.js
Last active June 17, 2018 14:46
Snippet to cheat at this silly color test https://www.xrite.com/hue-test, just paste the script into your console in devtools.
function extractNumber(element) {
const numberString = element.className.toLowerCase().split(" ")[1].split("fm-")[1];
return parseInt(numberString, 10);
}
function fixRow(number) {
let selectedRow = document.querySelectorAll(`.container-${number} #row-${number} > div`);
let rowArray = Array.prototype.slice.call(selectedRow);
@divanvisagie
divanvisagie / bash.sh
Created February 19, 2018 19:16
Orange Pi Zero (Medium Post) 2
echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ubnt.com/unifi/unifi-repo.gpg
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install unifi
@divanvisagie
divanvisagie / Dockerfile
Created February 19, 2018 18:53
Orange Pi Zero Unifi (Medium Post)
FROM resin/rpi-raspbian
MAINTAINER Erik de Vries <docker@erikdevries.nl>
RUN echo 'deb http://www.ubnt.com/downloads/unifi/debian unifi5 ubiquiti' | tee -a /etc/apt/sources.list.d/ubnt.list > /dev/null && \
apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50 && \
apt-get update && \
apt-get upgrade && \
apt-get install -y \
unifi \
&& \
#!/bin/sh
if git describe --exact-match --tags HEAD
then
tag=$(git describe --exact-match --tags HEAD)
echo "Found tag $tag"
sbt jdkPackager:packageBin
ghr -u divanvisagie $tag target/universal/jdkpackager/bundles
else
echo "Tag not found"