This file contains 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
Wohoo a test paste | |
with test text | |
and test linebreaks |
This file contains 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
ruby Discover if a number is prime http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ Source Article | |
class Fixnum | |
def prime? | |
('1' * self) !~ /^1?$|^(11+?)\1+$/ | |
end | |
end |
This file contains 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
# uninstall google updater | |
~/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Resources/install.py --uninstall | |
# prevent reinstall | |
touch ~/Library/Google/GoogleSoftwareUpdate | |
sudo chown root ~/Library/Google/GoogleSoftwareUpdate | |
sudo chmod 644 ~/Library/Google/GoogleSoftwareUpdate |
This file contains 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
if ([_target respondsToSelector:_targetAction]) { | |
if (_targetAction) { | |
void (*action)(id,SEL,id); | |
action = (void(*)(id,SEL,id))[_target methodForSelector:_targetAction]; | |
action(_target,_targetAction,self); | |
} | |
} |
This file contains 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 | |
let dir = "~/Desktop" | |
let file = "test.txt" | |
let path = dir.stringByExpandingTildeInPath | |
let filePath:NSString = path.stringByAppendingPathComponent(file) | |
var text: NSString = "random text with no meaning" | |
var textData: NSData = text.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) | |
var f: CMutablePointer = fopen(filePath.UTF8String, "w".UTF8String) |
This file contains 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
%!TEX TS-program = lualatex | |
%!TEX TS-options = --shell-escape | |
\documentclass{scrreprt} | |
\usepackage[autostyle]{csquotes} | |
\usepackage[urw-garamond]{mathdesign} | |
%\usepackage[euler-digits,euler-hat-accent]{eulervm} % math TODO: not working load before fontspec | |
\usepackage[no-math]{fontspec} |
This file contains 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
extension Character: ForwardIndexType { | |
public func successor() -> Character { | |
return Character(UnicodeScalar(String(self).unicodeScalars.first!.value + 1)) | |
} | |
} |
This file contains 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
postfix operator +++ {} | |
postfix func +++(inout left: Int) -> Int { | |
defer {left += 1} | |
return left | |
} | |
postfix operator --- {} | |
postfix func ---(inout left: Int) -> Int { | |
defer {left -= 1} | |
return left | |
} |