Skip to content

Instantly share code, notes, and snippets.

View naslundx's full-sized avatar

Marcus Näslund naslundx

View GitHub Profile
@naslundx
naslundx / delete_glacier_vault.sh
Created November 30, 2025 20:30
Bash script for removing AWS Glacier vaults (since you can't do it from the aws console)
#!/usr/bin/env bash
set -euo pipefail
# -----------------------------
# Usage: ./delete_glacier_vault.sh <VAULT_ARN>
#
# Example ARN:
# arn:aws:glacier:eu-north-1:123456789012:vaults/my-vault eu-north-1
#
# -----------------------------
@naslundx
naslundx / palindromical.cpp
Created January 21, 2018 18:41
Can a string be rearranged to a palindrome?
#include <string>
// Returns true if a string can be rearranged into a palindrome
bool isPalindromical(const std::string& str)
{
unsigned long count = 0;
// Count the parity of occurence of character c
for (const auto c : str)
count ^= 1 << c;
Dim cell as String
Dim a as Int
Dim b as Int
Dim c as Int
Dim found as Boolean
'Loopa över A-Z, sedan 01-12, sedan A-J
For a = 65 To 90
For b = 1 To 12
For c = 65 to 74
@naslundx
naslundx / melker.vba
Last active March 15, 2017 18:51
Melker 170315
Dim rows As Long
Dim i as Long
Dim locations(0 To 3119) as Int
Dim cell as String
Dim cellindex as Int
Dim num as Int
'Saker du hade med förut, vet inte om det behöver finnas med
Application.ScreenUpdating = False
Sheets("data").Select
for (float y = position.y; y <= position.y + size.y; y += tileSize)
{
if (tileIsSolid(m_level->get(position.x, y)))
{
position.x += (tileSize - fmod(position.x, tileSize))
}
}