Skip to content

Instantly share code, notes, and snippets.

View MrYakobo's full-sized avatar
Not AI

Jakob Lindskog MrYakobo

Not AI
View GitHub Profile
@MrYakobo
MrYakobo / dl.sh
Last active August 30, 2018 15:24
Automated download and extract process from https://wiiu.hacks.guide/get-started
#!/usr/bin/env bash
echo "This script follows the guide from https://wiiu.hacks.guide/get-started as of 2018-08-30."
mkdir -p SDCARD
cd SDCARD
declare -a files=(
https://wiiu.hacks.guide/assets/files/config.txt \
https://wiiu.hacks.guide/assets/files/config.ini \
https://github.com/vgmoose/hbas/releases/download/1.5/appstore15.zip \
@MrYakobo
MrYakobo / update-code
Created February 23, 2018 13:11
If your distro doesn't pack VSCode and you want to update it.
#!/bin/bash
curl -L https://vscode-update.azurewebsites.net/latest/linux-x64/stable | tar xz -C ~/Downloads/vscode/
# symlink ~/bin/code to ~/Downloads/vscode
ln -s ~/Downloads/vscode ~/bin/code
var a = $("a>img").map((i,t)=>$(t).attr('data-src'));
var arr = [];
for(var i = 0; i < a.length; i++)
arr.push(a[i]);
var c = arr.map(t=>{
var b = `-o ${/[^\/]+?\.png|[^\/]+?\.jpg/.exec(t)}`
if(b != null){
@MrYakobo
MrYakobo / example.png
Last active November 29, 2017 20:09
DNS setup for custom domain on Github
example.png
@MrYakobo
MrYakobo / exempel.js
Created June 29, 2017 22:27
Namnsdagar för hela året i en JSON-array.
//just i javascript är det lite småjobbigt att få fram ett index för nuvarande dag på året... suck
//https://stackoverflow.com/questions/8619879/javascript-calculate-the-day-of-the-year-1-366
Date.prototype.isLeapYear = function() {
var year = this.getFullYear();
if((year & 3) != 0) return false;
return ((year % 100) != 0 || (year % 400) == 0);
};
// Get Day of Year
Date.prototype.getDOY = function() {
@MrYakobo
MrYakobo / factorial.s
Last active May 22, 2017 09:23
factorial in ARM assembly
;R0 parameter
factorial
PUSH {R1, R2, LR}
CMP R0, #1
BEQ ret ; return 1
MOV R1, R0 ; kopiera R0 till R1
SUB R0, R0, #1 ; dec R0
BL factorial ; anropa factorial
MUL R2, R1, R0 ; int result = fact(n-1)*n
MOV R0, R2 ; R0 = result
@MrYakobo
MrYakobo / printf ARM
Last active May 13, 2022 11:26
print number to stdout in Raspberry Pi ARM Assembly
(this file changes the title of this Gist, ignore this)