Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
Programming

Sebastian Karlsson sebbekarlsson

🐧
Programming
View GitHub Profile
View answers.md
  1. Fråga hur man kan ta bort standard websida inställning

Menar du standard-styling? I så fall finns det lite olika sätt att göra det på. Jag brukar köra en global regel längst upp i min CSS för att få bort all margin / padding som webbläsaren lägger till:

* {
    margin: 0;
View helpers.js
function someParentFunction () {
this.someOtherFunction = function() {
this.hello() {
console.log("hello");
}
}
}
@sebbekarlsson
sebbekarlsson / javascript-events.json
Created Jan 28, 2021
All available Javascript events in JSON
View javascript-events.json
[
"error",
"abort",
"load",
"beforeunload",
"unload",
"online",
"offline",
"focus",
"blur",
View dump.txt
AST_COMPOUND[0x55ddda8b09b0](
-AST_FUNCTION[0x55ddda4ab940](
-(
--AST_NAME[0x55ddda4abab0](
---value
--)
-)
-{
--AST_COMPOUND[0x55ddda4abc50](
View input.js
import { ceil } from 'lodash';
console.log(ceil(25.3));
@sebbekarlsson
sebbekarlsson / Makefile
Created Dec 28, 2020
example of Makefile
View Makefile
DIR=$(HOME)/.name_day/
SERVICE_FILE=my_application.service
SERVICE_DIR=/lib/systemd/system/$(SERVICE_FILE)
install:
mkdir -p $(DIR)
cp ./$(SERVICE_FILE) $(SERVICE_DIR)
systemctl daemon-reload
start:
View main.js
fs = require("fs");
const N = 2020;
const FILENAME = "input.txt";
const ENCODING = "utf8";
fs.readFile(FILENAME, ENCODING, (_, data) =>
main(data.split("\n").map((line) => parseInt(line, 10)))
);
View input.txt
1446
1893
1827
1565
1728
497
1406
1960
1986
1945
View itoa-reverse.asm
.type itos, @function
itos:
pushl %ebp
movl %esp, %ebp
movl 8(%esp), %eax # number
movl $12, %edi
leal (%esp, %edi, 1), %ebx # buffer
movl $0, %edi # counter
movl $0, %esi
View itoa.asm
# Convert number to string
# (number, buffer) => buffer
.type itoa, @function
itoa:
pushl %ebp
movl %esp, %ebp
movl $12, %edi
leal (%esp, %edi, 1), %ebx # buffer
movl 8(%esp), %eax # number