Skip to content

Instantly share code, notes, and snippets.

View WhiteBlackGoose's full-sized avatar
🦆
Quack

WhiteBlackGoose

🦆
Quack
View GitHub Profile
@nskeip
nskeip / yandex_email_for_domain_settings.py
Last active February 23, 2024 15:03
Django SMTP settings for yandex_for_domain mail (pdd.yandex.ru)
EMAIL_HOST = 'smtp.yandex.ru'
EMAIL_HOST_USER = 'login@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
@Changaco
Changaco / btrfs-undelete
Last active July 18, 2024 18:18
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@nepsilon
nepsilon / how-to-ssh-agent.md
Last active June 3, 2024 05:05
Remember passphrases with ssh-agent — First published in fullweb.io issue #31

How to use ssh-agent to cache your SSH credentials?

Contributed by Fabien Loudet, Linux SysAdmin at Rosetta Stone

Tired of always having to enter your SSH key passphrase when logging in to remote machines? Here comes ssh-agent. Enter the passphrase once and it will keep it in memory for you

Using ssh-agent in your shell session:

@chrisdone
chrisdone / Printf.idr
Last active May 27, 2024 13:01
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@swlaschin
swlaschin / FsCsInterop.md
Last active July 9, 2024 15:41
F# to C# interop tips

Tips on exposing F# to C#

Api and Methods

I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.

In this file:

  • Define functions with PascalCase names. They will appear to C# as static methods.
  • Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
@ZacharyPatten
ZacharyPatten / AttributesMethodOverrides.cs
Created July 23, 2020 17:20
An example of using attributes to override default method implementations.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using static Syntax;
static class Program
{
static void Main()
@WhiteBlackGoose
WhiteBlackGoose / GenericTensor.md
Last active March 16, 2023 05:53
This is a short article about how I managed to implement basic generic tensor library

Generic tensor library in C# in a week

Hello!

For this article we take Tensor as a N-dimensional array whose last two axes might be interpreted as Matrix and/or the last axis might be interpreted as Vector. For TLDR the result is here.

What do we want?

  1. Tensors (N-dimensional storage)
  2. Implementation of methods and functions for working with tensors as with data storages
@ZacharyPatten
ZacharyPatten / VisualStudioSettings.md
Last active August 25, 2023 17:03
Just a reference of Visual Studio settings I use...

These are some notes about settings I like to use when I code in Visual Studio. They are completely optional.

  • Automatic brace completion = false
  • Dark Theme Tools -> Options -> Environment -> General
  • Disable Semicolon Bullshit Tools -> Options -> Text Editor -> C# -> IntelliSense
    • Automatically complete statement on semicolon = false
  • Control Click Tools -> Options -> Text Editor -> General
    • Enable mouse click to perform Go to Definition = false
  • Shift Key Overrides Tools -&gt; Options -&gt; Environment -&gt; Keyboard
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.IO.Pipes;
using System.Linq;
using System.Management;
using System.Net;