Skip to content

Instantly share code, notes, and snippets.

@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active May 4, 2024 07:38
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@VermeilChan
VermeilChan / compile-aseprite-win.md
Last active May 4, 2024 07:38
Compile Aseprite from source code for Windows 11/10 x64
@eiri
eiri / README.md
Created August 27, 2015 12:35
Demonstrate Erlang's 'busy wait' effect on CPU utilization

Demonstrate Erlang's 'busy wait' effect on CPU utilization

How?

Just make Erlang to do some light-load task in a bunch of relatively short leaving processes. Calculating PI to 80th digit in batches per 10 procs with short, 8 ms, sleep in-between, to give schedulers a breath space, will do.

Running

Run erl with 8 schedulers and no busy waiting on schedulers at all.

@tyanyaw
tyanyaw / clean-docker-for-mac.sh
Created September 2, 2023 10:20
Cleaning Docker.raw on Mac OS
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or

Installing Vaultwarden

Create a directory for the Vaultwarden data

sudo mkdir /opt/vw

Create a directory for the Vaultwarden Docker Compose file

mkdir vaultwarden
cd vaultwarden 
@OKatrych
OKatrych / ViewModels.kt
Created September 20, 2023 19:22
Composable scoped viewmodel
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.RememberObserver
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import timber.log.Timber
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@FedericoPonzi
FedericoPonzi / CI.yml
Last active May 4, 2024 07:19
Ready to use Github workflow for cross-compiling a rust binary to many Linux architectures.
# Instruction + template repo: https://github.com/FedericoPonzi/rust-ci
# Search and replace <YOUR_BINARY_NAME> with your binary name.
name: CI
on:
pull_request:
push:
branches:
- master
tags:
@amirrajan
amirrajan / explanation.md
Created August 7, 2019 18:24 — forked from AnanthVivekanand/explanation.md
Basic sound synth using SDL_audio, with some examples of frequency manipulation on a sine wave.
	SDL_Init(SDL_INIT_AUDIO);
	SDL_AudioSpec spec, aspec;
	SDL_zero(spec);
	spec.freq = 48000; //declare specs
	spec.format = AUDIO_S16SYS;
	spec.channels = 1;
	spec.samples = 4096;
	spec.callback = callback;
	spec.userdata = NULL;
@rjescobar
rjescobar / extend-trial-jetbrains-windows.bat
Created August 31, 2021 02:53
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"