This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
precedencegroup ExponentiativePrecedence { | |
higherThan: MultiplicationPrecedence | |
lowerThan: BitwiseShiftPrecedence | |
associativity: left | |
} | |
infix operator ^^: ExponentiativePrecedence | |
func ^^ (radix: Double, power: Double) -> Double { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${COMMAND} > /dev/null 2>&1 & | |
Eg. Redirect to different terminal: | |
${COMMAND} > /dev/ttys008 2>&1 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Terminal | |
export CLICOLOR=1 | |
export LSCOLORS=GxExBxBxFxegedabagacad | |
# Git http://bash-completion.alioth.debian.org/ | |
source ~/.git-completion.bash | |
# Aliases | |
alias whichip="ipconfig getifaddr en1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Delete the section referring to the submodule from the .gitmodules file | |
* Stage the changes via git add .gitmodules | |
* Delete the relevant section of the submodule from .git/config. | |
* Run git rm --cached path_to_submodule (no trailing slash) | |
* Run rm -rf .git/modules/path_to_submodule | |
* Commit the changes with `git commit -m "Removed submodule " | |
* Delete the now untracked submodule files rm -rf path_to_submodule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AsynchronousOperation: NSOperation { | |
override var asynchronous: Bool { | |
return true | |
} | |
private var _executing = false | |
override var executing: Bool { | |
get { | |
return _executing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <objc/runtime.h> | |
- (NSArray *)allPropertyNames | |
{ | |
unsigned count; | |
objc_property_t *properties = class_copyPropertyList([self class], &count); | |
NSMutableArray *rv = [NSMutableArray array]; | |
unsigned i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void)replaceSelector:(SEL)originalSelector withSelector:(SEL)swizzledSelector forClass:(Class)class | |
{ | |
Method originalMethod = class_getInstanceMethod(class, originalSelector); | |
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); | |
BOOL didAddMethod = | |
class_addMethod(class, | |
originalSelector, | |
method_getImplementation(swizzledMethod), | |
method_getTypeEncoding(swizzledMethod)); |