Skip to content

Instantly share code, notes, and snippets.

@1951FDG
1951FDG / new_gist_file.sh
Created October 27, 2013 12:19
DVD Authoring
<DVD>
cd /Volumes/Untitled\ 2/complete/lchd-tlibim720p.nfo
/Volumes/Untitled/Users/administrator/Developer/mkvdts2ac3/mkvdts2ac3.sh --new --no-dts --debug --wd /Volumes/Untitled\ 1
/Volumes/Untitled/Users/administrator/Developer/mkvdts2ac3/mkvdts2ac3.sh --new -n -w /Volumes/Untitled\ 2/complete/lchd-tlibim720p.nfo lchd-tlibim720p.mkv
mkvmerge -i lchd-tlibim720p-AC3.mkv
@1951FDG
1951FDG / new_gist_file.sh
Created October 27, 2013 11:53
Some defaults commands
defaults write -g com.apple.mouse.scaling -1
defaults write org.webkit.nightly.WebKit StartPageDisabled -bool YES
defaults delete -g NSFontPanelSizeSliderParams
defaults write com.apple.finder CreateDesktop -bool NO
defaults delete com.apple.finder CreateDesktop
killall Finder
defaults write com.apple.finder AppleShowAllFiles -bool YES
defaults delete com.apple.finder AppleShowAllFiles
@1951FDG
1951FDG / new_gist_file.sh
Created October 27, 2013 11:25
Usage of find
find / -name "*.txt" 2>/dev/null > list.txt
@1951FDG
1951FDG / new_gist_file.sh
Created October 27, 2013 11:14
Usage of lipo
lipo ~/Applications/Cong.app/Contents/MacOS/Cong -remove x86_64 -remove i386 -output ~/Applications/Cong.app/Contents/MacOS/Cong
update_dyld_shared_cache -root / -force
@1951FDG
1951FDG / new_gist_file
Created October 26, 2013 20:02
setgid 'procmod' permission
This special permission allows the file to be run with the security permissions of the group instead of the permission of the user who ran the program. This can be a source of security problems. The sgid permission is seen as an "S" in the group executable position in a long directory listing (ls -l). Has no effect if the file is not executable.
@1951FDG
1951FDG / new_gist_file
Created October 26, 2013 19:57
setuid 'root' permission
This special permission allows the file to be executed with the security permissions of the file owner instead of the permission of the user who ran the program. This can be a source of security problems. Some daemons run as suid root. The suid permission is seen as an "S" in the user executable position a long directory listing (ls -l). Has no effect if the file is not executable.
@1951FDG
1951FDG / new_gist_file
Created October 26, 2013 13:46
AppDNA notes
- Open MainMenu.xib with IB
- In IB – Save As MainMenu.nib (Choose NIB 3.x as File Type)
- In Xcode - Delete MainMenu.xib (Delete References)
- In Xcode – Resources > Add > Existing Files (English.lproj/MainMenu.nib)
- Build Release Configuration
-
- Done
Flattenned MainMenu.nib + MainMenu.xib = Non-Flattenned MainMenu.nib
@1951FDG
1951FDG / new_gist_file
Created October 24, 2013 12:09
Clang Static Analyzer
tar -xvzf ~/Downloads/untitled\ folder\ 6/checker-275.tar.bz2 -C ~/Developer
xcodebuild -configuration Release -alltargets clean;~/Developer/checker-275/scan-build --use-analyzer=/Developer/usr/bin/clang -V xcodebuild -configuration Release
xcodebuild -configuration Debug -alltargets clean;~/Developer/checker-275/scan-build --use-analyzer=/Developer/usr/bin/clang -V xcodebuild -configuration Debug
xcodebuild -configuration Release -alltargets clean;~/Developer/checker-275/scan-build -V -enable-checker alpha xcodebuild -configuration Release
xcodebuild -configuration Debug -alltargets clean;~/Developer/checker-275/scan-build -V -enable-checker alpha xcodebuild -configuration Debug
xcodebuild -list
xcodebuild -configuration Release -alltargets clean;~/Developer/checker-275/scan-build -V xcodebuild -target "ImageView" -configuration Release
@1951FDG
1951FDG / new_gist_file
Created October 24, 2013 10:03
Cocoa window notes
In fact, the two approaches are more or less identical. In the second one, [windowControllers addObject: newWindowController] has the same purpose as [newWindowController retain] in the first one -- to preserve a strong reference to the window controller -- and removeObject/release are similarly equivalent in purpose.
"The flag argument determines whether the window server creates a window device for the new object immediately. If flag is YES, it defers creating the window until the receiver is moved onscreen. All display messages sent to the NSWindow or its NSViews are postponed until the window is created, just before it's moved onscreen. Deferring the creation of the window improves launch time and minimizes the virtual memory load on the window server"
You can set this flag in IB or in code when creating a new window. An easy solution to your problems is probably to make sure that the window is made visible before you draw to it (or that you avoid drawing when it isn't visible), or that you make sure it
@1951FDG
1951FDG / new_gist_file.sh
Created October 21, 2013 10:07
Using kextstat to find third party kexts currently loaded
kextstat | grep -v apple