Skip to content

Instantly share code, notes, and snippets.

@CocoaBeans
CocoaBeans / KRStaticAnalyzerAnnotations.h
Created Feb 21, 2012
KRStaticAnalyzerAnnotations.h - Source code notations for the clang static analyser
View KRStaticAnalyzerAnnotations.h
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// KRStaticAnalyzerAnnotations.h
///
/// The Clang frontend supports several source-level annotations in the form of GCC-style attributes and pragmas
/// that can help make using the Clang Static Analyzer more useful. These annotations can both help suppress
/// false positives as well as enhance the analyzer's ability to find bugs.
///
/// For more info see: http://clang-analyzer.llvm.org/annotations.html
///
@CocoaBeans
CocoaBeans / gdbinit
Created Feb 21, 2012
.gdbinit - A user-friendly gdb configuration file
View gdbinit
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@CocoaBeans
CocoaBeans / DirectoryDestoryer.command
Last active Oct 4, 2015
Corrupt journal and bitmap of a given disk identifier
View DirectoryDestoryer.command
#!/bin/bash
#########################################################################################
###
### DirectoryDestoryer.command
### Corrupt journal and bitmap of a given disk identifier
###
### Copyright (c) 2013 Kevin Ross. All rights reserved.
###
### Redistribution and use in source and binary forms, with or without modification,
@CocoaBeans
CocoaBeans / git-delete-tag
Created Jan 16, 2013
Delete a tag from the local git repository and push it to origin
View git-delete-tag
#!/bin/bash #-x
GIT_TAG="${1}"
echo "Deleting remote git tag: ${GIT_TAG}"
git tag -d "${GIT_TAG}"
git push origin ":refs/tags/${GIT_TAG}"
@CocoaBeans
CocoaBeans / .profile
Created Jan 16, 2013
Custom Bash Prompt
View .profile
###############################################################
## Add custom command prompt
# Fill with minuses
# (this is recalculated every time the prompt is shown in function prompt_command):
fill="--- "
reset_style='\[\033[00m\]'
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
prompt_style=$reset_style
#command_style=$reset_style'\[\033[1;29m\]' # bold black
@CocoaBeans
CocoaBeans / Localizable.strings.m
Created Jan 16, 2013
Trick to add a warning comment to the top of Localizable.strings
View Localizable.strings.m
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// Localizable.strings.m
/// Checkmate
///
/// The following macro displays a message at the top of the Localizable.strings file warning anyone to not edit the file directly.
/// This is not meant to be localized by anyone and only serves as a warning.
/// We've placed this here so the genstrings build phase will process it and add it to Localizable.strings
///
/// Copyright (c) 2011 Micromat, Inc. All rights reserved.
@CocoaBeans
CocoaBeans / .gitignore
Created Jan 16, 2013
Common .gitignores for Cocoa development
View .gitignore
*.xcuserdatad/
docset-installed.txt
# OS X Finder
.DS_Store
# Xcode per-user config
*.mode1
*.mode1v3
*.mode2v3
@CocoaBeans
CocoaBeans / config.fish
Last active Dec 11, 2015
Fish shell custom prompt
View config.fish
########################################################################################
### Fish Custom Overrides
### Creates a shell prompt in the form of:
###
### ----------------------------------------------------------------------- 11:56:05
### kevin@kross /S/L/F/C/V/A/F/L/V/A/Support >
########################################################################################
set --global fish_prompt_username_color 555555
@CocoaBeans
CocoaBeans / .gitattributes
Created Jan 16, 2013
Common .gitattributes for Cocoa development
View .gitattributes
##################################################
## Attribute for diff'ing UTF-8 .strings files
*.strings -crlf set diff
##################################################
## Attribute to for easy merging of Xcode project files
*.pbxproj merge=union
@CocoaBeans
CocoaBeans / LSQuarantineEvent.command
Last active Dec 11, 2015
Bash functions to dump or delete events from the LaunchServices QuarantineEvents database
View LSQuarantineEvent.command
#!/bin/bash
DumpQuarantineEventsURLs()
{
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk '/.+/ {print}' | sort
}
DumpQuarantineEvents()
{