Skip to content

Instantly share code, notes, and snippets.

@siph
siph / building_a_standalone_nixvim.md
Created September 10, 2023 23:51
Building a standalone nixvim configuration

Building a standalone nixvim configuration

A standalone configuration is one that exists in its own project/repository. This means that you can externalize your entire neovim configuration, including flake inputs, nixpkgs version, etc...

This decoupling of neovim and NixOS configurations has multiple advantages including mixing stable/unstable nixpkgs and the ability to run your neovim configuration outside of your NixOS configuration. You can even run it outside of NixOS all together.

@windsting
windsting / nginx-stat-failed-13-permission-denied.md
Last active May 6, 2024 06:43
fix: Nginx: stat() failed (13: permission denied)

Nginx: stat() failed (13: permission denied)

from https://stackoverflow.com/questions/25774999/nginx-stat-failed-13-permission-denied

Nginx operates within the directory, so if you can't cd to that directory from the nginx user then it will fail (as does the stat command in your log). Make sure the www-user can cd all the way to the /username/test/static. You can confirm that the stat will fail or succeed by running

sudo -u www-data stat /username/test/static
@c5inco
c5inco / HeartRate.kt
Last active May 6, 2024 06:40
Jetpack Compose implementation of inspiration: https://twitter.com/amos_gyamfi/status/1494053914945236999
package des.c5inco.material3
import android.graphics.Matrix
import android.graphics.Path
import androidx.compose.animation.core.*
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
@nathanhaigh
nathanhaigh / deinterleave_fastq.sh
Last active May 6, 2024 06:38
deinterleave FASTQ files
#!/bin/bash
# Usage: deinterleave_fastq.sh < interleaved.fastq f.fastq r.fastq [compress]
#
# Deinterleaves a FASTQ file of paired reads into two FASTQ
# files specified on the command line. Optionally GZip compresses the output
# FASTQ files using pigz if the 3rd command line argument is the word "compress"
#
# Can deinterleave 100 million paired reads (200 million total
# reads; a 43Gbyte file), in memory (/dev/shm), in 4m15s (255s)
#
using UnityEditor;
using UnityEngine;
public sealed class ExampleClass : EditorWindow
{
private static readonly string[] mList =
{
"AboutWIndowLicenseLabel" ,
"AC LeftArrow" ,
"AC RightArrow" ,
@PyroGenesis
PyroGenesis / Instructions.md
Last active May 6, 2024 06:37
Instructions for dumping stack information of Winforms application using WER

Instructions

  1. Follow the instructions here to enable WER. Make sure the DumpType is set to 2 (Full Dumps).
  2. Make a new Module (static Class in C#) called ProgramEntryPoint.
  3. Copy the code written below and don't forget to change YOUR_STARTUP_FORM_NAME_HERE.
  4. Change project configuration to Debug
  5. Go to Project Properties. In the Application tab, uncheck "Enable application framework".
  6. Change Startup Object to Sub Main.
  7. Go to Debug -> Windows -> Exception Settings and make sure Common Language Runtime Exceptions is checked (full checked and not partially checked).
  8. Now whenever an unhandled exception occurs, your application will quit and a .dmp file will be created in the folder specified in the DumpFolder registry key.
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 6, 2024 06:36
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@noteeeeee
noteeeeee / JetBrainsActivation.md
Last active May 6, 2024 06:35
Webstorm/JetBrains products activation 2024 (Windows/MacOS)

Webstorm/JetBrains products activation 2024 (Windows/MacOS)

1.Proxy Settings

  1. Step 1: Navigate to Proxy settings.
  2. Step 2: Select "Manual proxy settings - HTTP".
    • Hostname: localhost
    • Port: 80

Set no proxy for:

@fnky
fnky / ANSI.md
Last active May 6, 2024 06:34
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@avseng
avseng / surveillance.py
Last active May 6, 2024 06:34
Raspberry Pi 4 surveillance system source code
import smtplib, email, os
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email import encoders
from picamera import PiCamera
from time import sleep
from datetime import datetime
import RPi.GPIO as GPIO