Skip to content

Instantly share code, notes, and snippets.

View sebbekarlsson's full-sized avatar
🐧
Programming

Sebastian Karlsson (ianertson) sebbekarlsson

🐧
Programming
View GitHub Profile
index 0, chars: a
index 1, chars: b
index 2, chars: c
index 3, chars: d
index 4, chars: e
index 5, chars: f
index 6, chars: g
index 7, chars: h
index 8, chars: i
index 9, chars: j
Mount like this:
sudo mount -t udf /home/yourname/.wine/drive_c/users/yourname/Downloads/Reaktor_Spark_R2.iso -o unhide /mnt/spark
@sebbekarlsson
sebbekarlsson / python-flask-nginx.md
Last active June 25, 2021 21:04
Creating a simple web application in Python and running it under Nginx

Python web application with Nginx

Let us create a simple API in Python and serving it using Nginx.

In this example we will use Debian 9 as a distro for the server.

The code

Alright, let's write some code.
We will create an API that will serve an array of fruits.

Let's create a __main__.py file:

  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;
function someParentFunction () {
this.someOtherFunction = function() {
this.hello() {
console.log("hello");
}
}
}
@sebbekarlsson
sebbekarlsson / javascript-events.json
Created January 28, 2021 14:45
All available Javascript events in JSON
[
"error",
"abort",
"load",
"beforeunload",
"unload",
"online",
"offline",
"focus",
"blur",
AST_COMPOUND[0x55ddda8b09b0](
-AST_FUNCTION[0x55ddda4ab940](
-(
--AST_NAME[0x55ddda4abab0](
---value
--)
-)
-{
--AST_COMPOUND[0x55ddda4abc50](
import { ceil } from 'lodash';
console.log(ceil(25.3));
@sebbekarlsson
sebbekarlsson / Makefile
Created December 28, 2020 06:10
example of 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:
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)))
);