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
require 'unicode' | |
class String | |
def downcase | |
Unicode::downcase(self) | |
end | |
def downcase! | |
self.replace downcase | |
end | |
def upcase |
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
mute=`osascript -e 'output muted of (get volume settings)'` | |
if [ $mute = true ]; then mute=false; else mute=true; fi | |
osascript -e "set volume output muted \"$mute\"" |
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
// | |
// Created by Andrey Streltsov on 09/03/16. | |
// | |
@import UIKit; | |
enum eViewControllerIndentifiers { | |
eIdentifier1, // the one with rendered whole course map | |
eIdentifier2, // the one with MapKit map | |
eIdentifier3 // the one with rendered hole map |
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
#!/bin/bash | |
find "$1" -type f -name "*.ape" -print0 | while read -d $'\0' song | |
do | |
output=${song%.ape}.mp3 | |
cue=${song%.ape}.cue | |
avconv -i "$song" -b 192k "$output" | |
if ls "$cue" &> /dev/null; then | |
mp3splt -a -c "$cue" "$output" |
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
#!/bin/sh | |
# Credits to author of this message(timgws): https://discussions.apple.com/thread/6693749?start=15&tstart=0 | |
function msg() { | |
foo=$2 | |
what="$(tr '[:lower:]' '[:upper:]' <<< ${foo:0:1})${foo:1}" | |
echo ">> ${what}ing $1..."; | |
} | |
function __blued() { |
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
# common alaises | |
# up one level | |
alias ..="cd .." | |
# unload cacher applications preferences on Yosemite and up(maybe on Maverick too) | |
alias fixpref='killall -u andrey cfprefsd' | |
# refresh locate database | |
alias updatedb=open_in_appcode | |
# detailed directory listing | |
alias ll="ls -l" |
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
// | |
// Created by Andrey Streltsov on 16/11/15. | |
// | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface UIImageView (CoordinateTransform) | |
-(CGPoint) pixelPointFromViewPoint:(CGPoint)viewPoint; | |
-(CGPoint) viewPointFromPixelPoint:(CGPoint)pixelPoint; |
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/Foundation.h> | |
@interface NSDictionary (XXXConvertValues) | |
// Return value associated wth key, converted to NSString | |
- (NSString *) stringValueForKey:(id)key; | |
// Return integer value associated with key, converted to integer | |
- (NSInteger) integerValueForKey:(id)key; |
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
void revealFile(QWidget* parent, const QString &pathToReveal) { | |
// See http://stackoverflow.com/questions/3490336/how-to-reveal-in-finder-or-show-in-explorer-with-qt | |
// for details | |
// Mac, Windows support folder or file. | |
#if defined(Q_OS_WIN) | |
const QString explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe")); | |
if (explorer.isEmpty()) { | |
QMessageBox::warning(parent, |
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 "PDFDocument.h" | |
bool PDFDocument::loadDocument(const char *filename){ | |
CFStringRef path; | |
CFURLRef url; | |
CGPDFDocumentRef document; | |
size_t count; | |