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 / 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)