Skip to content

Instantly share code, notes, and snippets.

--- a.txt	2020-02-06 10:28:05.000000000 +0000
+++ b.txt	2020-02-06 10:28:22.000000000 +0000
@@ -1,5 +1,5 @@
 module MyModule where
 
 foo :: [Int] -> [Int]
-foo ints = map bar (map baz ints)
+foo ints = map (bar . baz) ints
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
" Switch syntax highlighting on.
syntax on
" Enable file type detection and do language-dependent indenting.
filetype plugin indent on
set runtimepath^=~/.config/nvim/bundle/ctrlp.vim
@alexanderGugel
alexanderGugel / crawl.js
Created July 19, 2014 21:22
BitTorrent DHT Crawler; No Redis DB required
var bencode = require('bencode'),
dgram = require('dgram'),
hat = require('hat'),
_ = require('lodash');
// Put in a function. The returned function won't ever throw an error. This is
// quite useful for malformed messages.
var makeSafe = function (fn, onFuckedUp) {
return function () {
try {
@alexanderGugel
alexanderGugel / gist:f3e8e82b606dac9624b4
Created November 10, 2014 22:07
Node.JS Redis in production
// Port, host and auth token of Redis server might be defined as environment
// variables. If not, fall back to defaults.
var redisPort = process.env.REDIS_PORT || 6379,
redisHost = process.env.REDIS_HOST || '127.0.0.1',
redisAuth = process.env.REDIS_AUTH || null,
redis = require('redis');
// Since we are waiting for the error event, we don't have to check for errors
// individually after each Redis command.
var onError = function (error) {