Shut down without showing a confirmation dialog:
osascript -e 'tell app "System Events" to shut down'
Shut down after showing a confirmation dialog:
osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
| #!/bin/bash | |
| # From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
| # | |
| ARGS=2 | |
| E_BADARGS=99 | |
| if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
| then |
| import logging | |
| import multiprocessing | |
| import time | |
| import mplog | |
| FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s' | |
| logging.basicConfig(level=logging.DEBUG, format=FORMAT) | |
| existing_logger = logging.getLogger('x') |
| { echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080 |
| #![feature(unboxed_closures)] | |
| #![feature(fn_traits)] | |
| #[derive(Clone)] | |
| struct Pr { | |
| pat: i32 //, mat: Matcher<'a,'a> | |
| } | |
| type MState = i32; |
| module DataCodata where | |
| open import Data.Product using (_×_ ; _,_) | |
| open import Data.Sum using (_⊎_ ; inj₁ ; inj₂) | |
| -------------------------------------------------------------------------------- | |
| case : ∀ {ℓ ℓ′ ℓ″} → {X : Set ℓ} {Y : Set ℓ′} {Z : Set ℓ″} |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>mwd.sleepMac</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/path/to/sleepMac.sh</string> | |
| </array> |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE Rank2Types #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| module ShapeIndexed where | |
| import Data.Constraint | |
Shut down without showing a confirmation dialog:
osascript -e 'tell app "System Events" to shut down'
Shut down after showing a confirmation dialog:
osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
| {-# LANGUAGE ConstraintKinds #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE PartialTypeSignatures #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE TypeFamilies #-} |