Skip to content

Instantly share code, notes, and snippets.

View MikaelPorttila's full-sized avatar
🇸🇪
Yo!

Mikael Porttila MikaelPorttila

🇸🇪
Yo!
  • Noble Bits
  • Stockholm, Sweden
View GitHub Profile
const loadMoreBtn = document.getElementById('load_more_button');
const loader = document.getElementById('inventory_history_loading');
const exportData = () => {
const teamSize = 5;
const rows = [...document.querySelectorAll('#personaldata_elements_container > table > tbody > tr')];
rows.shift(); // Remove header row.
const matches = rows.map((match) => {
const meta = [...match.querySelectorAll('.csgo_scoreboard_inner_left td')].map(node => node.innerText);
@MikaelPorttila
MikaelPorttila / git-pull-all.ps
Last active August 12, 2020 20:03
Refresh all git repositories (require pwsh 7.0)
Get-ChildItem | ForEach-Object -Parallel { git -C $_ fetch; git -C $_ pull; } -ThrottleLimit 2
@MikaelPorttila
MikaelPorttila / Nancy 2.0 + Aurelia setup guide
Last active January 21, 2017 12:38
Nancy 2.0 + Aurelia setup guide
1. Create new empty NetCore Web project using dotnet cli or Visual Studio 2017.
2. Run following nuget cmds + update existing nuget-packages to latest and greatest:
Install-Package Nancy -Pre
Install-Package Microsoft.AspNetCore.Owin
Install-Package Microsoft.AspNetCore.StaticFiles
3. Append the Configure method in Startup.cs with:
app.UseDefaultFiles();
app.UseStaticFiles();
@MikaelPorttila
MikaelPorttila / app.html
Created August 22, 2016 12:18
DI inheritance
<template>
<h1>${message}</h1>
</template>
<!DOCTYPE html>
<html>
<head>
<title>Aurelia</title>
</head>
<body aurelia-app="main">
<script src="scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Aurelia</title>
</head>
<body aurelia-app="main">
<script src="scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Aurelia</title>
</head>
<body aurelia-app="main">
<script defer src="https://cdn.jsdelivr.net/bluebird/latest/bluebird.js"></script>
<script defer src="scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script>
</body>
<template>
<div repeat.for="item of items">
<label>
${item.value}:
<input type="number"
value.one-way="item.index"
change.delegate="updateIndex(item, $event.target.value)">
</label>
</div>
</template>