Skip to content

Instantly share code, notes, and snippets.

;; Monty Hall problem (Let's Make a Deal gameshow)
;; http://www.marilynvossavant.com/articles/gameshow.html
(use '(incanter core stats charts))
;; set a simulation sample size
(def n 10000)
;; generate samples of initial-guesses, prize-doors, and switch decisions
(def initial-guesses (sample [1 2 3] :size n))
(def prize-doors (sample [1 2 3] :size n))
kern.ostype = Darwin
kern.osrelease = 10.6.0
kern.osrevision = 199506
kern.version = Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386
kern.maxvnodes = 132096
kern.maxproc = 532
kern.maxfiles = 12288
kern.argmax = 262144
kern.securelevel = 0
kern.hostname = taquito.local
@dominiklessel
dominiklessel / NSImage+OpenCV.h
Created February 1, 2012 09:08
NSImage to cv::Mat and vice versa
//
// NSImage+OpenCV.h
//
#import <AppKit/AppKit.h>
@interface NSImage (NSImage_OpenCV) {
}
@developerinlondon
developerinlondon / docker.md
Last active April 11, 2025 18:01
Docker saving and loading images

Here's how to save and load docker images:

Example scenario: To save a docker image from a docker repository and save it as a tar file locally.

  1. Save the image as a tarball

docker save repositoryname:tag > repotag.tar

  1. Zip the image
@xiao99xiao
xiao99xiao / gist:0509091001bdd6259249
Created August 16, 2014 15:04
Creating XPC helper for root privilege
1. Add Copy File build phase, Destination: Wrapper, Subpath: Contents/Library/LaunchServices, Codesign on Copy:Disable.
2. Modify Info.plist for Both target:
2.1 Add "Tools owned after installation" in App's Info.plist, value is: identifier "<helper's bundle identifier>" and anchor apple generic and certificate leaf[subject.CN] = "<Certificate Name>" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */
2.2 Add "Clients allowed to add and remove tool" in Helper's Info.plist, it is a array, so item 0's value is: identifier "<app's bundle identifier>" and anchor apple generic and certificate leaf[subject.CN] = "<Certificate Name>" and certificate 1[field.1.2.840.113635.100.6.2.1] /* exists */
2.3 Make sure each .plist file is set as Info.plist in Target's Build settings.
@yunga
yunga / Cliref.md
Last active January 13, 2025 00:56
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     [email protected]
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@gaga5lala
gaga5lala / restore_docker_image_tag.sh
Created November 7, 2017 02:04
Restore docker image tag from text file.
# 1. Backup image tags to text file.
# $ docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" > img_id.txt
#
# 2. Execute clean-docker-for-mac script
# $ bash clean-docker-for-mac.sh $(docker images --format "{{.ID}}" | xargs)
#
# source: https://gist.github.com/MrTrustor/e690ba75cefe844086f5e7da909b35ce#file-clean-docker-for-mac-sh
#
# 3. Execute this script to restore tags from text file.
@0xch4z
0xch4z / README.md
Last active April 14, 2020 16:36
symbolication instructions
### if Xcode starts misbehaving you can use:
defaults delete com.apple.dt.Xcode
rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
### and for the simulators
xcrun simctl erase all