Skip to content

Instantly share code, notes, and snippets.

@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active October 31, 2024 20:59
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@danclien
danclien / cabal-sandbox-install
Last active August 29, 2015 14:16
Compiles a binary in a temporary sandbox and moves the binaries to \$HOME/.cabal/bin or to the path set by SANDBOX_INSTALL_DIR.
#!/usr/bin/env bash
# Utility functions
## Logging
log_debug() {
if [ "$OPT_VERBOSE" = true ]; then
echo "$(tput setaf 5)Debug: $(tput sgr 0)" "$@"
fi
}
$ sudo gem install guard
$ sudo gem install guard-shell
links:
- https://github.com/guard/guard
- https://github.com/guard/guard-shell
Create a file named "Guardfile" in the root of the project and put the following lines in it:
guard :shell do
@bitemyapp
bitemyapp / gist:ac316a6eb666695ff7d2
Last active November 4, 2020 04:11
How I talk about Haskell when I want people to care about learning Haskell

Fire up ghci. Make the text real big. Always show the types for everything as you go!

Takes ~1 hour generally.

Note: if you object to "uncertainty" (evocative of data/value flow possibilities), consider wording like "simultaneously possible values". It's a reference to how the compiler won't know whether Maybe a is a Just a or a Nothing statically. Don't blather at me about dependent types; I know.

Alternate verbiage for uncertainty: product - simultaneous altogetherness, sum - simultaneous singlehood. Also consider what the category theoretic diagrams look like. Can be instructive.

Suggestions taken under advisement.

@arosien
arosien / runar-io-free.scala
Last active September 10, 2016 07:17
Translation of Runar's ScalaIO 2013 presentation on IO and Free monads (http://blog.higher-order.com/assets/scalaio.pdf) to scalaz.
import scalaz._
import Scalaz._
import Free._
/** "Pure" interactions with a console. */
sealed trait Console[+A]
case class GetLine[A](k: String => A) extends Console[A]
case class PutLine[A](s: String, a: A) extends Console[A]
object Console {
@thoughtpolice
thoughtpolice / CoYoneda.hs
Last active December 27, 2019 01:52
CoYoneda = Yoneda
{-# LANGUAGE ExistentialQuantification, RankNTypes #-}
{-# LANGUAGE InstanceSigs #-}
module CoYoneda where
import Data.IORef
import Data.Set (Set, map)
import Control.Monad (liftM)
--------------------------------------------------------------------------------
-- Yoneda