Skip to content

Instantly share code, notes, and snippets.

View aligusnet's full-sized avatar

Alexander Ignatyev aligusnet

View GitHub Profile
@cdepillabout
cdepillabout / small-lens-example.hs
Last active August 3, 2017 17:07
small example of using lens
#!/usr/bin/env stack
-- stack --resolver lts-9.0 script --package transformers --package lens -- -Wall
-- If you have stack installed, all you need to do is make this file executable
-- and you can run it from the command line.
module Main where
import Control.Lens (Prism', Traversal', _1, _2, preview, prism', set)
@EshaMaharishi
EshaMaharishi / decorations_mongodb.md
Last active October 1, 2024 12:45
Decorations in MongoDB

The Decorator Pattern

A Decoration is an object that is stored as part of another object, called the Decorable.

The lifetime of the Decoration is tied to the lifetime of the Decorable. This means the Decoration is constructed when the Decorable's constructor is called, and the Decoration is destructed when the Decorable's destructor is called.

Finally, the decoration can only be accessed through the decorable.

The Decorator pattern is an easy way to add parts to an existing object without changing the object.

@tegansnyder
tegansnyder / disable mcafee endpoint protection.md
Last active October 29, 2024 13:49
Disable McAffee Endpoint Protection OSX

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas

alternatively

sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e