Skip to content

Instantly share code, notes, and snippets.

@arnu515
arnu515 / App.svelte
Created January 17, 2021 15:22
Basic routing using PageJS in svelte
<script lang="ts">
import page from "page";
import { setContext } from "svelte";
import { parse } from "qs";
import Index from "./routes/index.svelte";
export let apiUrl: string;
setContext<string>("apiUrl", apiUrl);
let component: any, query: any, params: any;
@arnu515
arnu515 / security.py
Created December 16, 2020 13:21
Security.py file I use in my projects (Mostly for my reference)
from cryptography.fernet import Fernet
import bcrypt
import os
# THESE KEYS ARE VISIBLE KEYS AND ARE NOT INTENDED FOR PRODUCTION
# SEPARATE KEYS MUST BE DECLARED FOR PRODUCTION
# THESE KEYS ARE ONLY INTENDED FOR DEVELOPMENT
f1 = Fernet(os.getenv("FERNET_KEY_1", "XF6OymR9AUpgZE9j_O3H7oY_9EwrEvCs7O2sYQmyskk=").encode())
f2 = Fernet(os.getenv("FERNET_KEY_2", "HovvX4QOJd-cpGKGPmqqY3EH0AGbw1gfHmQM2LpIrRo=").encode())
f3 = Fernet(os.getenv("FERNET_KEY_3", "WziTQwFIoHbqAU8KvY7Lc5wIRfE6LfjdaW3Lm7pnc0U=").encode())
@arnu515
arnu515 / .zshrc
Last active August 16, 2020 10:40
# arnu515's .zshrc aliases. NOT FULL .zshrc FILE!
# ALIASES
# Make directory and cd into it. Usage: mc <dirname>
mc () {
mkdir $1 && cd $1
}
alias ..="cd .."
alias l="ls -al"