Skip to content

Instantly share code, notes, and snippets.

@mikeplavsky
mikeplavsky / reduce.py
Last active February 4, 2019 13:29
question1.py
reduce(lambda acc, x: [*acc, x], range(3,9), [10,11,12])
def f(L):
if L == []:
return []
pivot = L[0]
return ( f([x for x in L[1:] if x < pivot]) + [pivot] + f([x for x in L[1:] if x >= pivot]) )
@dmitshur
dmitshur / gist:6927554
Last active September 17, 2023 07:35
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.

WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@maplpro
maplpro / gist:589552
Created September 21, 2010 11:40
python virtual environment
import sys
sys.path.append('C:\\Program Files\\Quest Software\\Site Administrator for SharePoint\\SharePoint Information Portal\\Python25\\Lib')
sys.path.append( 'C:\\Program Files\\Quest Software\\Site Administrator for SharePoint\\SharePoint Information Portal\\Python25\\DLLs' )
sys.path.append('C:\\Program Files\\Quest Software\\Site Administrator for SharePoint\\SharePoint Information Portal')
sys.path.append('C:\\Program Files\\Quest Software\\Site Administrator for SharePoint\\SharePoint Information Portal\\Application')
sys.path.append( r'C:\Program Files\Quest Software\Site Administrator for SharePoint\SharePoint Information Portal\Python25\Lib\site-packages' )